Image Coding Method and Device Using Transform Skip Flag

ABSTRACT

A method for decoding an image according to the present document includes obtaining prediction mode information and residual related information from a bitstream, deriving prediction samples of a current block by performing prediction based on the prediction mode information, deriving residual samples of the current block based on the residual related information, and generating reconstruction samples of the current block based on the prediction samples and the residual samples, and the residual related information includes a transform skip flag based on a size of the current block and a maximum transform skip size, the transform skip flag represents whether a transform skip is applied to the current block, and information about the maximum transform skip size is obtained from the bitstream.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation application of Ser. No. 17/669,044,filed Feb. 10, 2022, which is a continuation application of Ser. No.17/138,494, filed Dec. 30, 2020, now U.S. Pat. No. 11,297,310, which isa continuation application of Ser. No. 16/852,735, filed Apr. 20, 2020,now U.S. Pat. No. 10,917,637, which is continuation of InternationalApplication PCT/KR2020/000757, with an international filing date of Jan.15, 2020, which claims the benefit of U.S. Provisional Application No.62/792,423 filed on Jan. 15, 2019, the contents of which are all herebyincorporated by reference herein in their entirety.

BACKGROUND OF THE DISCLOSURE Field of the Disclosure

The present document relates to an image coding technology, and moreparticularly, to an image coding method and device using a transformskip flag in an image coding system.

Related Art

Demand for high-resolution, high-quality images such as HD (HighDefinition) images and UHD (Ultra High Definition) images has beenincreasing in various fields. As the image data has high resolution andhigh quality, the amount of information or bits to be transmittedincreases relative to the legacy image data Therefore, when image datais transmitted using a medium such as a conventional wired/wirelessbroadband line or image data is stored using an existing storage medium,the transmission cost and the storage cost thereof are increased.

Accordingly, there is a need for a highly efficient image compressiontechnique for effectively transmitting, storing, and reproducinginformation of high resolution and high quality images.

SUMMARY

The present document provides a method and a device for enhancing imagecoding efficiency.

The present document provides a method and a device for enhancing theefficiency of residual coding.

The present document provides a method and a device for enhancing theefficiency of the residual coding according to whether to apply atransform skip.

The present document provides a method and a device for enhancing theefficiency of the residual coding by variably setting a maximumtransform skip size.

According to an embodiment of the present document, a method fordecoding an image performed by a decoding apparatus is provided. Themethod includes obtaining prediction mode information and residualrelated information from a bitstream, deriving prediction samples of acurrent block by performing prediction based on the prediction modeinformation, deriving residual samples of the current block based on theresidual related information, and generating reconstruction samples ofthe current block based on the prediction samples and the residualsamples, and the residual related information includes a transform skipflag based on a size of the current block and a maximum transform skipsize, the transform skip flag represents whether a transform skip isapplied to the current block, and information about the maximumtransform skip size is obtained from the bitstream.

According to another embodiment of the present document, a decodingapparatus which performs an image decoding is provided. The decodingapparatus includes an entropy decoder which obtains prediction modeinformation and residual related information from a bitstream, apredictor which derives prediction samples of a current block byperforming prediction based on the prediction mode information, aresidual processor which derives residual samples of the current blockbased on the residual related information, and an adder which generatesreconstruction samples of the current block based on the predictionsamples and the residual samples, and the residual related informationincludes a transform skip flag based on a size of the current block anda maximum transform skip size, the transform skip flag representswhether a transform skip is applied to the current block, andinformation about the maximum transform skip size is obtained from thebitstream.

According to still another embodiment of the present document, a methodfor encoding a video performed by an encoding apparatus is provided. Themethod includes deriving prediction samples by performing prediction ona current block, deriving residual samples for the current block, andencoding image information including prediction mode information aboutthe prediction and residual related information about the residualsamples, and the residual related information includes a transform skipflag based on a size of the current block and a maximum transform skipsize, the transform skip flag represents whether a transform skip isapplied to the current block, and the image information includesinformation about the maximum transform skip size.

According to yet another embodiment of the present document, a videoencoding apparatus is provided. The encoding apparatus includes apredictor which derives prediction samples by performing prediction on acurrent block, a residual processor which derives residual samples forthe current block, and an entropy encoder which encodes imageinformation including prediction mode information about the predictionand residual related information about the residual samples, and theresidual related information includes a transform skip flag based on asize of the current block and a maximum transform skip size, thetransform skip flag represents whether a transform skip is applied tothe current block, and the image information includes information aboutthe maximum transform skip size.

According to still yet another embodiment of the present document, acomputer readable digital storage medium is provided. The computerreadable digital storage medium stores image information which causesthe decoding method to be performed.

According to a further embodiment of the present document, a computerreadable digital storage medium is provided. The computer readabledigital storage medium stores image information generated by theencoding method.

According to the present document, it is possible to enhance the overallimage/video compaction efficiency.

According to the present document, it is possible to enhance theefficiency of the residual coding by using the transform skippresence/absence flag.

According to the present document, it is possible to enhance theefficiency of the residual coding by variably setting the maximumtransform skip size.

According to the present document, it is possible to enhance the codingefficiency by efficiently transmitting the residual signal representedby the pixel domain having the characteristics different from those ofthe residual signal of the general transform domain.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a diagram schematically illustrating an example of avideo/image coding system to which the present document may be applied.

FIG. 2 is a diagram schematically explaining a configuration of avideo/image encoding apparatus to which the present document may beapplied.

FIG. 3 is a diagram schematically explaining a configuration of avideo/image decoding apparatus to which the present document may beapplied.

FIG. 4 is a diagram illustrating an example of a dequantization andinverse transformer.

FIG. 5 is a diagram illustrating an example of an inverse secondarytransform unit and an inverse primary transform unit.

FIG. 6 is a diagram illustrating an example of an inverse transformmethod based on transform related parameters.

FIG. 7 is a diagram illustrating an example of a specific inversetransform method.

FIG. 8 is a block diagram of a CABAC encoding system according to anembodiment.

FIG. 9 is a diagram illustrating an example of transform coefficientswithin a 4×4 block.

FIG. 10 is a diagram illustrating a residual signal decoder according toan embodiment of the present document.

FIG. 11 is a diagram illustrating a transform skip flag parsingdeterminator according to an embodiment of the present document.

FIG. 12 is a flowchart for explaining a method for coding a transformskip presence/absence flag according to an embodiment of the presentdocument.

FIGS. 13 and 14 are diagrams schematically illustrating an example of avideo/image encoding method and related components according toembodiment (s) of the present document.

FIGS. 15 and 16 are diagrams schematically illustrating an example ofthe video/image decoding method and related components according to theembodiment (s) of the present document.

FIG. 17 is a diagram schematically illustrating a contents streamingsystem structure.

FIG. 18 illustrates Table 48.

FIG. 19 illustrates Table 49.

FIG. 20 illustrates Table 50.

FIG. 21 illustrates Table 55.

DESCRIPTION OF EXEMPLARY EMBODIMENTS

The present document may be modified in various forms, and specificembodiments thereof will be described and illustrated in the drawings.However, the embodiments are not intended for limiting the presentdocument. The terms used in the following description are used to merelydescribe specific embodiments, but are not intended to limit the presentdocument. An expression of a singular number includes an expression ofthe plural number, so long as it is clearly read differently. The termssuch as “include” and “have” are intended to represent that features,numbers, steps, operations, elements, components, or combinationsthereof used in the following description exist and it should be thusunderstood that the possibility of existence or addition of one or moredifferent features, numbers, steps, operations, elements, components, orcombinations thereof is not excluded.

Each of the components in the drawings described in the present documentare illustrated independently for the convenience of descriptionregarding different characteristic functions, and do not mean that thecomponents are implemented in separate hardware or separate software.For example, two or more of each configuration may be combined to formone configuration, or one configuration may be divided into a pluralityof configurations. Embodiments in which each configuration is integratedand/or separated are also included in the scope of the present documentwithout departing from the spirit of the present document.

Hereinafter, exemplary embodiments of the present document will bedescribed in detail with reference to the accompanying drawings.Hereinafter, the same reference numerals are used for the samecomponents in the drawings, and redundant description of the samecomponents is omitted.

FIG. 1 illustrates an example of a video/image coding system to whichembodiments of the present specification may be applied.

Referring to FIG. 1 , a video/image coding system may include a firstapparatus (source device) and a second apparatus (reception device). Thesource device may transmit encoded video/image information or data tothe reception device through a digital storage medium or network in theform of a file or streaming.

The source device may include a video source, an encoding apparatus, anda transmitter. The reception device may include a receiver, a decodingapparatus, and a renderer. The encoding apparatus may be called avideo/image encoding apparatus, and the decoding apparatus may be calleda video/image decoding apparatus. The transmitter may be included in theencoding apparatus. The receiver may be included in the decodingapparatus. The renderer may include a display, and the display may beconfigured as a separate device or an external component.

The video source may obtain video/image through a process of capturing,synthesizing, or generating the video/image. The video source mayinclude a video/image capture device and/or a video/image generatingdevice. The video/image capture device may include, for example, one ormore cameras, video/image archives including previously capturedvideo/images, and the like. The video/image generating device mayinclude, for example, computers, tablets and smartphones, and may(electronically) generate video/images. For example, a virtualvideo/image may be generated through a computer or the like. In thiscase, the video/image capturing process may be replaced by a process ofgenerating related data.

The encoding apparatus may encode input video/image. The encodingapparatus may perform a series of procedures such as prediction,transform, and quantization for compression and coding efficiency. Theencoded data (encoded video/image information) may be output in the formof a bitstream.

The transmitter may transmit the encoded image/image information or dataoutput in the form of a bitstream to the receiver of the receivingdevice through a digital storage medium or a network in the form of afile or streaming. The digital storage medium may include variousstorage mediums such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, and thelike. The transmitter may include an element for generating a media filethrough a predetermined file format and may include an element fortransmission through a broadcast/communication network. The receiver mayreceive/extract the bitstream and transmit the received bitstream to thedecoding apparatus.

The decoding apparatus may decode the video/image by performing a seriesof procedures such as dequantization, inverse transform, and predictioncorresponding to the operation of the encoding apparatus.

The renderer may render the decoded video/image. The renderedvideo/image may be displayed through the display.

The present document relates to video/image coding. For example, themethod/embodiment disclosed in the present document may be applied tothe method disclosed in the versatile video coding (VVC) standard, theEVC (essential video coding) standard, the AOMedia Video 1 (AV1)standard, the 2nd generation of audio video coding standard (AVS2), orthe next generation video/image coding standard (ex. H.267 or H.268,etc.).

The present document presents various embodiments of video/image coding,and the embodiments may be performed in combination with each otherunless otherwise mentioned.

In the present document, a video may mean a set of a series of imagesover time. A picture generally means a unit representing one image in aspecific time zone, and a slice/tile is a unit configuring a part of thepicture in coding. The slice/tile may include one or more coding treeunits (CTUs). One picture may be composed of one or more slices/tiles.One picture may be composed of one or more tile groups. One tile groupmay include one or more tiles. A brick may represent a rectangularregion of CTU rows within a tile in a picture. A tile may be partitionedinto multiple bricks, each of which consists of one or more CTU rowswithin the tile. A tile that is not partitioned into multiple bricks maybe also referred to as a brick. A tile which is not partitioned intomultiple bricks may also be referred to as a brick. A brick scan mayrepresent a specific sequential ordering of the CTUs partitioning apicture in which the CTUs may be ordered in a CTU raster scan within thebrick, the bricks within the tile may be ordered consecutively in theraster scan of the bricks of the tile, and tiles in a picture may beordered consecutively in the raster scan of the tiles of the picture. Atile is a rectangular region of CTUs within a particular tile column anda particular tile row. The tile column is a rectangular region of CTUshaving a height equal to the height of the picture, and a widthspecified by syntax elements in the picture parameter set. The tile rowis a rectangular region of CTUs having a height specified by syntaxelements in the picture parameter set and a width equal to the width ofthe picture. A tile scan is a specific sequential ordering of CTUspartitioning a picture in which the CTUs are ordered consecutively in aCTU raster scan in a tile whereas tiles in a picture are orderedconsecutively in a raster scan of the tiles of the picture. A sliceincludes an integer number of bricks of a picture that may beexclusively contained in a single NAL unit. A slice may consist ofeither a number of complete tiles or only a consecutive sequence ofcomplete bricks of one tile. The tile group and the slice may be usedinterchangeably in the present document. For example, in the presentdocument, the tile group/tile group header may be referred to as aslice/slice header.

A pixel or a pel may mean a smallest unit constituting one picture (orimage). In addition, ‘sample’ may be used as a term corresponding to apixel. A sample may generally represent a pixel or a value of a pixel,and may represent only a pixel/pixel value of a luma component or only apixel/pixel value of a chroma component.

A unit may represent a basic unit of image processing. The unit mayinclude at least one of a specific region of the picture and informationrelated to the region. One unit may include one luma block and twochroma (ex. cb, cr) blocks. The unit may be used interchangeably withterms such as block or area in some cases. In a general case, an M×Nblock may include samples (or sample arrays) or a set (or array) oftransform coefficients of M columns and N rows.

In the present document, the term “I” and “,” should be interpreted torepresent “and/or.” For instance, the expression “A/B” may mean “Aand/or B.” Further, “A, B” may mean “A and/or B.” Further, “A/B/C” maymean “at least one of A, B, and/or C.” In addition, “A/B/C may mean “atleast one of A, B, and/or C.”)

Further, in the present document, the term “or” should be interpreted torepresent “and/or.” For instance, the expression “A or B” maycomprise 1) only A, 2) only B, and/or 3) both A and B. That is, the term“or” in the present document should be interpreted to represent“additionally or alternatively.”

FIG. 2 is a diagram schematically explaining a configuration of avideo/image encoding apparatus to which the present document may beapplied. Hereinafter, the video encoding apparatus may include an imageencoding apparatus.

Referring to FIG. 2 , the encoding apparatus 200 includes an imagepartitioner 210, a predictor 220, a residual processor 230, an entropyencoder 240, an adder 250, a filter 260, and a memory 270. The predictor220 may include an inter predictor 221 and an intra predictor 222. Theresidual processor 230 may include a transformer 232, a quantizer 233, adequantizer 234, and an inverse transformer 235. The residual processor230 may further include a subtractor 231. The adder 250 may be called areconstructor or a reconstructed block generator. The image partitioner210, the predictor 220, the residual processor 230, the entropy encoder240, the adder 250, and the filter 260 may be configured by at least onehardware component (ex. an encoder chipset or processor) according to anembodiment. In addition, the memory 270 may include a decoded picturebuffer (DPB) or may be configured by a digital storage medium. Thehardware component may further include the memory 270 as aninternal/external component.

The image partitioner 210 may partition an input image (or a picture ora frame) input to the encoding apparatus 200 into one or moreprocessors. For example, the processor may be called a coding unit (CU).In this case, the coding unit may be recursively partitioned accordingto a quad-tree binary-tree ternary-tree (QTBTTT) structure from a codingtree unit (CTU) or a largest coding unit (LCU). For example, one codingunit may be partitioned into a plurality of coding units of a deeperdepth based on a quad tree structure, a binary tree structure, and/or aternary structure. In this case, for example, the quad tree structuremay be applied first and the binary tree structure and/or ternarystructure may be applied later. Alternatively, the binary tree structuremay be applied first. The coding procedure according to the presentdocument may be performed based on the final coding unit that is nolonger partitioned. In this case, the largest coding unit may be used asthe final coding unit based on coding efficiency according to imagecharacteristics, or if necessary, the coding unit may be recursivelypartitioned into coding units of deeper depth and a coding unit havingan optimal size may be used as the final coding unit. Here, the codingprocedure may include a procedure of prediction, transform, andreconstruction, which will be described later. As another example, theprocessor may further include a predictor (PU) or a transformer (TU). Inthis case, the predictor and the transformer may be split or partitionedfrom the aforementioned final coding unit. The predictor may be a unitof sample prediction, and the transformer may be a unit for deriving atransform coefficient and/or a unit for deriving a residual signal fromthe transform coefficient.

The unit may be used interchangeably with terms such as block or area insome cases. In a general case, an M×N block may represent a set ofsamples or transform coefficients composed of M columns and N rows. Asample may generally represent a pixel or a value of a pixel, mayrepresent only a pixel/pixel value of a luma component or represent onlya pixel/pixel value of a chroma component. A sample may be used as aterm corresponding to one picture (or image) for a pixel or a pel.

In the encoding apparatus 200, a prediction signal (predicted block,prediction samples array) output from the inter predictor 221 or theintra predictor 222 is subtracted from an input image signal (originalblock, original sample array) to generate a residual signal residualblock, residual sample array), and the generated residual signal istransmitted to the transformer 232. In this case, as illustrated, a unitfor subtracting a prediction signal (predicted block, prediction samplesarray) from the input image signal (original block, original samplearray) in the encoder 200 may be called a subtractor 231. The predictormay perform prediction on a block to be processed (hereinafter, referredto as a current block) and generate a predicted block includingprediction samples for the current block. The predictor may determinewhether intra prediction or inter prediction is applied on a currentblock or CU basis. As described later in the description of eachprediction mode, the predictor may generate various information relatedto prediction, such as prediction mode information, and transmit thegenerated information to the entropy encoder 240. The information aboutthe prediction may be encoded in the entropy encoder 240 and output inthe form of a bitstream.

The intra predictor 222 may predict the current block by referring tothe samples in the current picture. The referred samples may be locatedin the neighborhood of the current block or may be located apartaccording to the prediction mode. In the intra prediction, predictionmodes may include a plurality of non-directional modes and a pluralityof directional modes. The non-directional mode may include, for example,a DC mode and a planar mode. The directional mode may include, forexample, 33 directional prediction modes or 65 directional predictionmodes according to the degree of detail of the prediction direction.However, this is merely an example, more or less directional predictionmodes may be used depending on a setting. The intra predictor 222 maydetermine the prediction mode applied to the current block by using aprediction mode applied to a neighboring block.

The inter predictor 221 may derive a predicted block for the currentblock based on a reference block (reference sample array) specified by amotion vector on a reference picture. Here, in order to reduce theamount of motion information transmitted in the inter prediction mode,the motion information may be predicted in units of blocks, sub-blocks,or samples based on correlation of motion information between theneighboring block and the current block. The motion information mayinclude a motion vector and a reference picture index. The motioninformation may further include inter prediction direction (L0prediction, L1 prediction, Bi prediction, etc.) information. In the caseof inter prediction, the neighboring block may include a spatialneighboring block present in the current picture and a temporalneighboring block present in the reference picture. The referencepicture including the reference block and the reference pictureincluding the temporal neighboring block may be the same or different.The temporal neighboring block may be called a collocated referenceblock, a co-located CU (colCU), and the like, and the reference pictureincluding the temporal neighboring block may be called a collocatedpicture (colPic). For example, the inter predictor 221 may configure amotion information candidate list based on neighboring blocks andgenerate information representing which candidate is used to derive amotion vector and/or a reference picture index of the current block.Inter prediction may be performed based on various prediction modes. Forexample, in the case of a skip mode and a merge mode, the interpredictor 221 may use motion information of the neighboring block asmotion information of the current block. In the skip mode, unlike themerge mode, the residual signal may not be transmitted. In the case ofthe motion vector prediction (MVP) mode, the motion vector of theneighboring block may be used as a motion vector predictor and themotion vector of the current block may be represented by signaling amotion vector difference.

The predictor 220 may generate a prediction signal based on variousprediction methods described below. For example, the predictor may notonly apply intra prediction or inter prediction to predict one block butalso simultaneously apply both intra prediction and inter prediction.This may be called combined inter and intra prediction (CIIP). Inaddition, the predictor may be based on an intra block copy (IBC)prediction mode or a palette mode for prediction of a block. The IBCprediction mode or palette mode may be used for content image/videocoding of a game or the like, for example, screen content coding (SCC).The IBC basically performs prediction in the current picture but may beperformed similarly to inter prediction in that a reference block isderived in the current picture. That is, the IBC may use at least one ofthe inter prediction techniques described in the present document. Thepalette mode may be considered as an example of intra coding or intraprediction. When the palette mode is applied, a sample value within apicture may be signaled based on information about the palette table andthe palette index.

The prediction signal generated through the predictor (including theinter predictor 221 and/or the intra predictor 222) may be used togenerate a reconstructed signal or may be used to generate a residualsignal. The transformer 232 may generate transform coefficients byapplying a transform technique to the residual signal. For example, thetransform technique may include at least one of a Discrete CosineTransform (DCT), a Discrete Sine Transform (DST), a Karhunen-LoèveTransform (KLT), a Graph-Based Transform (GBT), or a ConditionallyNon-linear Transform (CNT). Here, the GBT means a transform obtainedfrom a graph when the relationship information between pixels isgraphically represented. The CNT means a transform obtained bygenerating the prediction signal by using all previously reconstructedpixels and based on the prediction signal. In addition, the transformprocess may also be applied to pixel blocks having the same size of asquare, or may also be applied to blocks of variable sizes other thanthe square.

The quantizer 233 may quantize the transform coefficients and transmitthem to the entropy encoder 240 and the entropy encoder 240 may encodethe quantized signal (information about the quantized transformcoefficients) and output a bitstream. The information about thequantized transform coefficients may be referred to as residualinformation. The quantizer 233 may rearrange block type quantizedtransform coefficients into a one-dimensional vector form based on acoefficient scanning order and generate information about the quantizedtransform coefficients based on the quantized transform coefficients inthe one-dimensional vector form. Information on transform coefficientsmay be generated. The entropy encoder 240 may perform various encodingmethods such as, for example, exponential Golomb, context-adaptivevariable length coding (CAVLC), context-adaptive binary arithmeticcoding (CABAC), and the like. The entropy encoder 240 may encodeinformation necessary for video/image reconstruction other thanquantized transform coefficients (ex. values of syntax elements, etc.)together or separately. Encoded information (ex. encoded video/imageinformation) may be transmitted or stored in units of NALs (networkabstraction layer) in the form of a bitstream. The video/imageinformation may further include information about various parameter setssuch as an adaptation parameter set (APS), a picture parameter set(PPS), a sequence parameter set (SPS), or a video parameter set (VPS).In addition, the video/image information may further include generalconstraint information. In the present document, information and/orsyntax elements transmitted/signaled from the encoding apparatus to thedecoding apparatus may be included in video/picture information. Thevideo/image information may be encoded through the above-describedencoding procedure and included in the bitstream. The bitstream may betransmitted over a network or may be stored in a digital storage medium.The network may include a broadcasting network and/or a communicationnetwork, and the digital storage medium may include various storagemedia such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, and the like. Atransmitter (not illustrated) transmitting a signal output from theentropy encoder 240 and/or a storage unit (not illustrated) storing thesignal may be included as internal/external element of the encodingapparatus 200, and alternatively, the transmitter may be included in theentropy encoder 240.

The quantized transform coefficients output from the quantizer 233 maybe used to generate a prediction signal. For example, the residualsignal (residual block or residual samples) may be reconstructed byapplying dequantization and inverse transform to the quantized transformcoefficients through the dequantizer 234 and the inverse transformer235. The adder 250 adds the reconstructed residual signal to theprediction signal output from the inter predictor 221 or the intrapredictor 222 to generate a reconstructed signal (reconstructed picture,reconstructed block, reconstructed sample array). If there is noresidual for the block to be processed, such as a case where the skipmode is applied, the predicted block may be used as the reconstructedblock. The adder 250 may be called a reconstructor or a reconstructedblock generator. The generated reconstructed signal may be used forintra prediction of a next block to be processed in the current pictureand may be used for inter prediction of a next picture through filteringas described below.

Meanwhile, luma mapping with chroma scaling (LMCS) may be applied duringpicture encoding and/or reconstruction.

The filter 260 may improve subjective/objective image quality byapplying filtering to the reconstructed signal. For example, the filter260 may generate a modified reconstructed picture by applying variousfiltering methods to the reconstructed picture and store the modifiedreconstructed picture in the memory 270, specifically, a DPB of thememory 270. The various filtering methods may include, for example,deblocking filtering, a sample adaptive offset, an adaptive loop filter,a bilateral filter, and the like. The filter 260 may generate variousinformation related to the filtering and transmit the generatedinformation to the entropy encoder 240 as described later in thedescription of each filtering method. The information related to thefiltering may be encoded by the entropy encoder 240 and output in theform of a bitstream.

The modified reconstructed picture transmitted to the memory 270 may beused as the reference picture in the inter predictor 221. When the interprediction is applied through the encoding apparatus, predictionmismatch between the encoding apparatus 200 and the decoding apparatusmay be avoided and encoding efficiency may be improved.

The DPB of the memory 270 may store the modified reconstructed picturefor use as a reference picture in the inter predictor 221. The memory270 may store the motion information of the block from which the motioninformation in the current picture is derived (or encoded) and/or themotion information of the blocks in the picture that have already beenreconstructed. The stored motion information may be transmitted to theinter predictor 221 and used as the motion information of the spatialneighboring block or the motion information of the temporal neighboringblock. The memory 270 may store reconstructed samples of reconstructedblocks in the current picture and may transfer the reconstructed samplesto the intra predictor 222.

FIG. 3 is a diagram schematically explaining a configuration of avideo/image decoding apparatus to which the present document may beapplied.

Referring to FIG. 3 , the decoding apparatus 300 may include an entropydecoder 310, a residual processor 320, a predictor 330, an adder 340, afilter 350, and a memory 360. The predictor 330 may include an interpredictor 331 and an intra predictor 332. The residual processor 320 mayinclude a dequantizer 321 and an inverse transformer 321. The entropydecoder 310, the residual processor 320, the predictor 330, the adder340, and the filter 350 may be configured by a hardware component (ex. adecoder chipset or a processor) according to an embodiment. In addition,the memory 360 may include a decoded picture buffer (DPB) or may beconfigured by a digital storage medium. The hardware component mayfurther include the memory 360 as an internal/external component.

When a bitstream including video/image information is input, thedecoding apparatus 300 may reconstruct an image corresponding to aprocess in which the video/image information is processed in theencoding apparatus of FIG. 2 . For example, the decoding apparatus 300may derive units/blocks based on block partition related informationobtained from the bitstream. The decoding apparatus 300 may performdecoding using a processor applied in the encoding apparatus. Thus, theprocessor of decoding may be a coding unit, for example, and the codingunit may be partitioned according to a quad tree structure, binary treestructure and/or ternary tree structure from the coding tree unit or thelargest coding unit. One or more transformers may be derived from thecoding unit. The reconstructed image signal decoded and output throughthe decoding apparatus 300 may be reproduced through a reproducingapparatus.

The decoding apparatus 300 may receive a signal output from the encodingapparatus of FIG. 2 in the form of a bitstream, and the received signalmay be decoded through the entropy decoder 310. For example, the entropydecoder 310 may parse the bitstream to derive information (ex.video/image information) necessary for image reconstruction (or picturereconstruction). The video/image information may further includeinformation about various parameter sets such as an adaptation parameterset (APS), a picture parameter set (PPS), a sequence parameter set(SPS), or a video parameter set (VPS). In addition, the video/imageinformation may further include general constraint information. Thedecoding apparatus may further decode picture based on the informationabout the parameter set and/or the general constraint information.Signaled/received information and/or syntax elements described later inthe present document may be decoded may decode the decoding procedureand obtained from the bitstream. For example, the entropy decoder 310decodes the information in the bitstream based on a coding method suchas exponential Golomb coding, CAVLC, or CABAC, and output syntaxelements required for image reconstruction and quantized values oftransform coefficients for residual. More specifically, the CABACentropy decoding method may receive a bin corresponding to each syntaxelement in the bitstream, determine a context model using a decodingtarget syntax element information, decoding information of a decodingtarget block or information of a symbol/bin decoded in a previous stage,and perform an arithmetic decoding on the bin by predicting aprobability of occurrence of a bin according to the determined contextmodel, and generate a symbol corresponding to the value of each syntaxelement. In this case, the CABAC entropy decoding method may update thecontext model by using the information of the decoded symbol/bin for acontext model of a next symbol/bin after determining the context model.The information related to the prediction among the information decodedby the entropy decoder 310 may be provided to the predictor (the interpredictor 332 and the intra predictor 331), and the residual value onwhich the entropy decoding was performed in the entropy decoder 310,that is, the quantized transform coefficients and related parameterinformation, may be input to the residual processor 320. The residualprocessor 320 may derive the residual signal (the residual block, theresidual samples, the residual sample array). In addition, informationabout filtering among information decoded by the entropy decoder 310 maybe provided to the filter 350. Meanwhile, a receiver (not illustrated)for receiving a signal output from the encoding apparatus may be furtherconfigured as an internal/external element of the decoding apparatus300, or the receiver may be a component of the entropy decoder 310.Meanwhile, the decoding apparatus according to the present document maybe referred to as a video/image/picture decoding apparatus, and thedecoding apparatus may be classified into an information decoder(video/image/picture information decoder) and a sample decoder(video/image/picture sample decoder). The information decoder mayinclude the entropy decoder 310, and the sample decoder may include atleast one of the dequantizer 321, the inverse transformer 322, the adder340, the filter 350, the memory 360, the inter predictor 332, and theintra predictor 331.

The dequantizer 321 may dequantize the quantized transform coefficientsand output the transform coefficients. The dequantizer 321 may rearrangethe quantized transform coefficients in the form of a two-dimensionalblock form. In this case, the rearrangement may be performed based onthe coefficient scanning order performed in the encoding apparatus. Thedequantizer 321 may perform dequantization on the quantized transformcoefficients by using a quantization parameter (ex. quantization stepsize information) and obtain transform coefficients.

The inverse transformer 322 inversely transforms the transformcoefficients to obtain a residual signal (residual block, residualsample array).

The predictor may perform prediction on the current block and generate apredicted block including prediction samples for the current block. Thepredictor may determine whether intra prediction or inter prediction isapplied to the current block based on the information about theprediction output from the entropy decoder 310 and may determine aspecific intra/inter prediction mode.

The predictor 320 may generate a prediction signal based on variousprediction methods described below. For example, the predictor may notonly apply intra prediction or inter prediction to predict one block butalso simultaneously apply intra prediction and inter prediction. Thismay be called combined inter and intra prediction (CIIP). In addition,the predictor may be based on an intra block copy (IBC) prediction modeor a palette mode for prediction of a block. The IBC prediction mode orpalette mode may be used for content image/video coding of a game or thelike, for example, screen content coding (SCC). The IBC basicallyperforms prediction in the current picture but may be performedsimilarly to inter prediction in that a reference block is derived inthe current picture. That is, the IBC may use at least one of the interprediction techniques described in the present document. The palettemode may be considered as an example of intra coding or intraprediction. When the palette mode is applied, a sample value within apicture may be signaled based on information about the palette table andthe palette index.

The intra predictor 331 may predict the current block by referring tothe samples in the current picture. The referred samples may be locatedin the neighborhood of the current block or may be located apartaccording to the prediction mode. In the intra prediction, predictionmodes may include a plurality of non-directional modes and a pluralityof directional modes. The intra predictor 331 may determine theprediction mode applied to the current block by using a prediction modeapplied to a neighboring block.

The inter predictor 332 may derive a predicted block for the currentblock based on a reference block (reference sample array) specified by amotion vector on a reference picture. In this case, in order to reducethe amount of motion information transmitted in the inter predictionmode, motion information may be predicted in units of blocks,sub-blocks, or samples based on correlation of motion informationbetween the neighboring block and the current block. The motioninformation may include a motion vector and a reference picture index.The motion information may further include inter prediction direction(L0 prediction, L1 prediction, Bi prediction, etc.) information. In thecase of inter prediction, the neighboring block may include a spatialneighboring block present in the current picture and a temporalneighboring block present in the reference picture. For example, theinter predictor 332 may configure a motion information candidate listbased on neighboring blocks and derive a motion vector of the currentblock and/or a reference picture index based on the received candidateselection information. Inter prediction may be performed based onvarious prediction modes, and the information about the prediction mayinclude information representing a mode of inter prediction on thecurrent block.

The adder 340 may generate a reconstructed signal (reconstructedpicture, reconstructed block, reconstructed sample array) by adding theobtained residual signal to the prediction signal (predicted block,prediction samples array) output from the predictor (including the interpredictor 332 and/or the intra predictor 331). If there is no residualfor the block to be processed, such as when the skip mode is applied,the predicted block may be used as the reconstructed block.

The adder 340 may be called reconstructor or a reconstructed blockgenerator. The generated reconstructed signal may be used for intraprediction of a next block to be processed in the current picture, maybe output through filtering as described below, or may be used for interprediction of a next picture.

Meanwhile, luma mapping with chroma scaling (LMCS) may be applied in thepicture decoding process.

The filter 350 may improve subjective/objective image quality byapplying filtering to the reconstructed signal. For example, the filter350 may generate a modified reconstructed picture by applying variousfiltering methods to the reconstructed picture and store the modifiedreconstructed picture in the memory 360, specifically, a DPB of thememory 360. The various filtering methods may include, for example,deblocking filtering, a sample adaptive offset, an adaptive loop filter,a bilateral filter, and the like.

The (modified) reconstructed picture stored in the DPB of the memory 360may be used as a reference picture in the inter predictor 332. Thememory 360 may store the motion information of the block from which themotion information in the current picture is derived (or decoded) and/orthe motion information of the blocks in the picture that have alreadybeen reconstructed. The stored motion information may be transmitted tothe inter predictor 260 so as to be utilized as the motion informationof the spatial neighboring block or the motion information of thetemporal neighboring block. The memory 360 may store reconstructedsamples of reconstructed blocks in the current picture and transfer thereconstructed samples to the intra predictor 331.

In the present disclosure, the embodiments described in the filter 260,the inter predictor 221, and the intra predictor 222 of the encodingapparatus 200 may be the same as or respectively applied to correspondto the filter 350, the inter predictor 332, and the intra predictor 331of the decoding apparatus 300. The same may also apply to the unit 332and the intra predictor 331.

As described above, in performing video coding, prediction is performedto increase compression efficiency. Therefore, a predicted blockincluding the prediction samples for the current block which is a codingtarget block may be generated. Here, the predicted block includes theprediction samples in a spatial domain (or pixel domain). The predictedblock is derived identically in the encoding apparatus and the decodingapparatus, and the encoding apparatus may signal information about theresidual (residual information) between the original block and thepredicted block, rather than the original sample value itself of theoriginal block, to the decoding apparatus, thereby increasing imagecoding efficiency. The decoding apparatus may derive a residual blockincluding residual samples based on the residual information, generate areconstructed block including reconstructed samples by summing theresidual block and the predicted block, and generate a reconstructedpicture including the reconstructed blocks.

The residual information may be generated through transform andquantization procedures. For example, the encoding apparatus may signalrelated residual information (through a bitstream) to the decodingapparatus by deriving the residual block between the original block andthe predicted block, deriving transform coefficients by performing thetransform procedure for the residual samples (residual sample array)included in the residual block, and deriving quantized transformcoefficients by performing the quantization procedure for the transformcoefficients. Here, the residual information may include informationsuch as value information, position information, transform technique,transform kernel, and quantization parameter of the quantized transformcoefficients. The decoding apparatus may perform dequantization/inversetransform procedures based on the residual information and derive theresidual samples (or residual blocks). The decoding apparatus maygenerate a reconstructed picture based on the predicted block and theresidual block. The encoding apparatus may also dequantize/inverselytransform the quantized transform coefficients for reference for theinter prediction of the post-picture to derive the residual block, andgenerate the reconstructed picture based thereon.

In the present document, the transformer, the quantizer, the dequantizeror the inverse transformer of the encoding apparatus in FIG. 2 , or thedequantizer or the inverse transformer of the decoding apparatus in FIG.3 will be described in detail. Here, the encoding apparatus may derive abitstream from information transformed and quantized through entropyencoding, and the decoding apparatus may derive the transformed andquantized information from the bitstream through entropy decoding.Hereinafter, the dequantizer and the inverse transformer will bedescribed, and the transformer and the quantizer may inversely performthe same operation as in the dequantizer and the inverse transformer. Inaddition, the dequantizer and the inverse transformer may be representedby a dequantization and inverse transformer, and the transformer and thequantizer may also be represented by a transform and quantizer.

In addition, in the present document, Multiple Transform Selection (MTS)may mean a method for performing transform by using at least twotransform types. This may also be expressed as an Adaptive MultipleTransform (AMT) or an Explicit Multiple Transform (EMT), and likewise,mts_idx may also be expressed as AMT_idx, EMT_idx, AMT_TU_idx,EMT_TU_idx, transform index, transform combination index, or the like,and the present document is not limited to such expression.

FIG. 4 illustrates an example of the dequantization and inversetransformer.

Referring to FIG. 4 , the dequantization and inverse transformer 400 mayinclude a dequantizer 410, an inverse secondary transform unit 420, andan inverse primary transform unit 430.

The dequantizer 410 may obtain a transform coefficient by performing thedequantization for an entropy decoded signal (or quantized transformcoefficient) by using quantization step size information, and theinverse secondary transform unit 420 may perform an inverse secondarytransform for the transform coefficient. In addition, the inverseprimary transform unit 430 may perform an inverse primary transform forthe inverse secondary transformed signal or block (or transformcoefficient), and a residual signal decoded through the inverse primarytransform may be obtained. Here, the inverse secondary transform mayrepresent an inverse transform of the secondary transform, and theinverse primary transform may represent the inverse transform of theprimary transform.

In the present document, a transform combination may be configured foreach transform configuration group which is classified by at least oneof a prediction mode, a block size, or a block shape, and the inverseprimary transform unit 430 may perform the inverse transform based onthe transform combination which is configured by the present document.In addition, embodiments to be described later in the present documentmay be applied.

FIG. 5 illustrates an example of the inverse secondary transform unitand the inverse primary transform unit.

Specifically describing the inverse transform process with reference toFIG. 5 , the inverse transform process may use an inverse secondarytransform application presence/absence determinator (or element whichdetermines whether to apply the inverse secondary transform) 510, aninverse secondary transform determinator (or element which determinesthe inverse secondary transform) 520, an inverse secondary transformunit 530, and an inverse primary transform unit 540. Here, the inversesecondary transform unit 420 illustrated in FIG. 4 may be the same asthe inverse secondary transform unit 530 illustrated in FIG. 5 , and mayalso include at least one of the inverse secondary transform applicationpresence/absence determinator 510, the inverse secondary transformdeterminator 520, and the inverse secondary transform unit 530illustrated in FIG. 5 , but may be changed according to expression, suchthat the present document is not limited thereto. In addition, theinverse primary transform unit 430 illustrated in FIG. 4 may be the sameas the inverse primary transform unit 540 illustrated in FIG. 5 , butmay be changed according to expression, such that the present documentis not limited thereto.

The inverse secondary transform application presence/absencedeterminator 510 may determine whether to apply the inverse secondarytransform. For example, the inverse secondary transform may be NSST orRST. For example, the inverse secondary transform applicationpresence/absence determinator 510 may determine whether to apply theinverse secondary transform based on a second transform flag receivedfrom the encoding apparatus. As another example, the inverse secondarytransform application presence/absence determinator 510 may alsodetermine whether to apply the inverse secondary transform based on thetransform coefficient of the residual block.

The inverse secondary transform determinator 520 may determine theinverse secondary transform. At this time, the inverse secondarytransform determinator 520 may determine the inverse secondary transformapplied to the current block based on the NSST (or RST) transform setwhich is designated according to an intra prediction mode.

In addition, for example, a secondary transform determining method maybe determined depending on a primary transform determining method.Various several combinations of the primary transform and the secondarytransform may be determined according to the intra prediction mode.

In addition, for example, the inverse secondary transform determinator520 may also determine an area to which the inverse secondary transformis applied based on the size of the current block.

The inverse secondary transform unit 530 may perform the inversesecondary transform for the dequantized residual block by using thedetermined inverse secondary transform.

The inverse primary transform unit 540 may perform the inverse primarytransform for the inverse secondary transformed residual block. Theprimary transform may be referred to as a core transform. For example,the inverse primary transform unit 540 may perform the primary transformby using the aforementioned MTS. In addition, for example, the inverseprimary transform unit 540 may determine whether the MTS is applied tothe current block.

For example, when the MTS is applied to the current block (or when avalue of a tu_mts_flag syntax element is 1), the inverse primarytransform unit 540 may configure an MTS candidate based on the intraprediction mode of the current block. In addition, the inverse primarytransform unit 540 may determine the primary transform applied to thecurrent block by using an mts_idx syntax element indicating a specificMTS among the configured MTS candidates.

FIG. 6 is an example of an inverse transform method based on transformrelated parameters.

Referring to FIG. 6 , an embodiment may obtain asps_mts_intra_enabled_flag syntax element or asps_mts_inter_enabled_flag syntax element (S600). Here, thesps_mts_intra_enabled_flag syntax element may represent informationabout whether the tu_mts_flag syntax element is included in the residualcoding syntax of the intra coding unit. For example, when the value ofthe sps_mts_intra_enabled_flag syntax element is 0, the tu_mts_flagsyntax element may not be included in the residual coding syntax of theintra coding unit, and when the sps_mts_intra_enabled_flag syntaxelement is 1, the tu_mts_flag syntax element may be included in theresidual coding syntax of the intra coding unit.

In addition, the sps_mts_inter_enabled_flag syntax element may representinformation about whether the tu_mts_flag syntax element is included inthe residual coding syntax of the inter coding unit. For example, whenthe value of the sps_mts_inter_enabled_flag syntax element is 0, thetu_mts_flag syntax element may not be included in the residual codingsyntax of the inter coding unit, and when the value of thesps_mts_inter_enabled_flag syntax element is 1, the tu_mts_flag syntaxelement may be included in the residual coding syntax of the intercoding unit.

Here, the tu_mts_flag syntax element may represent whether MultipleTransform Selection (MTS) is applied to the residual sample of the lumatransform block.

An embodiment may obtain the tu_mts_flag syntax element based on thesps_mts_intra_enabled_flag syntax element or thesps_mts_inter_enabled_flag syntax element (S610). For example, when thevalue of the sps_mts_intra_enabled_flag syntax element or thesps_mts_inter_enabled_flag syntax element is 1, an embodiment may obtainthe tu_mts_flag syntax element. For example, when the value of thetu_mts_flag syntax element is 0, the MTS may not be applied to theresidual sample of the luma transform block, and when the value of thetu_mts_flag syntax element is 1, the MTS may be applied to the residualsample of the luma transform block.

An embodiment may obtain an mts_idx syntax element based on thetu_mts_flag syntax element (S620). Here, the mts_idx syntax element mayrepresent information about which transform kernel is applied to lumaresidual samples according to horizontal and/or vertical directions of acurrent (luma) transform block. For example, when the value of thetu_mts_flag syntax element is 1, an embodiment may obtain the mts_idxsyntax element. Alternatively, when the value of the tu_mts_flag syntaxelement is 0, an embodiment may not obtain the mts_idx syntax element.

An embodiment may induce a transform kernel corresponding to the mts_idxsyntax element (S630). Alternatively, an embodiment may derive thetransform kernel based on the mts_idx syntax element.

Meanwhile, in another embodiment, at least one of the embodiments of thepresent document may also be applied to the tu_mts_flag syntax elementand/or the mts_idx syntax element.

For example, the tu_mts_flag syntax element may be included in theresidual coding syntax based on the sps_mts_intra_enabled_flag syntaxelement or the sps_mts_inter_enabled_flag syntax element, and themts_idx syntax element may be included in the transform unit syntaxbased on the tu_mts_flag syntax element.

Alternatively, for example, the sps_mts_intra_enabled_flag syntaxelement may be represented by a sps_explicit_mts_intra_enabled_flagsyntax element, and the sps_mts_inter_enabled_flag syntax element may berepresented by a sps_explicit_mts_inter_enabled_flag syntax element.Alternatively, the tu_mts_flag syntax element may be omitted, and themts_idx syntax element may also be included in the coding unit syntaxbased on the sps_explicit_mts_intra_enabled_flag syntax element or thesps_explicit_mts_inter_enabled_flag syntax element.

For example, the transform kernel corresponding to the mts_idx syntaxelement may be defined by being classified into a horizontal transformand a vertical transform. Alternatively, the transform kernel determinedbased on the mts_idx syntax element may be classified into thehorizontal transform and the vertical transform. Meanwhile, differenttransform kernels may be applied to the horizontal transform and thevertical transform, but the same transform kernel may also be appliedthereto, such that the present document is not limited thereto.

For example, information about the transform kernel applied to thehorizontal transform and the vertical transform which are determinedbased on the mts_idx syntax element may be as illustrated in Table 1 orTable 2.

TABLE 1 mts_idx[xTbY][yTbY][cIdx] trTypeHor trTypeVer −1 0 0 0 1 1 1 2 12 1 2 3 2 2

TABLE 2 mts_idx 0 1 2 3 4 trTypeHor 0 1 2 1 2 trTypeVer 0 1 1 2 2

An embodiment may perform an inverse transform based on the transformkernel (S640). In the present document, the inverse transform may berepresented by the transform or may also be represented by the inverseof the transform.

FIG. 7 is an example of a specific inverse transform method.

Referring to FIG. 7 , an embodiment may confirm a transform size (nTbS)(S710). For example, the transform size (nTbS) may be a variablerepresenting the horizontal sample size of scaled transformcoefficients.

An embodiment may confirm a transform kernel type (trType) (S720). Forexample, the transform kernel type (trType) may be a variablerepresenting the type of transform kernel, and various embodiments ofthe present document may be applied. For example, the transform kerneltype may also represent trTypeHor or trTypeVer illustrated in FIG. 6 .

An embodiment may perform transform matrix multiplication based on atleast one of the transform size (nTbS) or the transform kernel type(trType) (S730). For example, a specific operation may be applied basedon the transform kernel type (trType). Alternatively, for example, apredetermined transform matrix may be applied based on the transformsize (nTbS) and the transform kernel type (trType).

An embodiment may derive a transform sample based on the transformmatrix multiplication (S740).

The encoding apparatus/decoding apparatus may perform the aforementionedinverse transform process, and the encoding apparatus may also performthe transform process which is the inverse of the aforementioned inversetransform process.

FIG. 8 is a block diagram of a CABAC encoding system according to anembodiment, and illustrates a block diagram of context-adaptive binaryarithmetic coding (CABAC) for coding a single syntax element.

The encoding process of the CABAC first transforms an input signal to abinary value through binarization when the input signal is a syntaxelement rather than a binary value. When the input signal is already abinary value, the input signal may be input by being bypassed withoutthe binarization, that is, to a coding engine. Here, each binary 0 or 1configuring the binary value may be referred to as a bin. For example,when a binary string after the binarization is 110, each of 1, 1, and 0is referred to as a bin. The bin (s) for one syntax element mayrepresent a value of the corresponding syntax element.

The binarized bins may be input to a regular coding engine or a bypasscoding engine.

The regular coding engine may assign a context model reflecting aprobability value to the corresponding bin, and code the correspondingbin based on the assigned context model. The regular coding engine mayupdate the probability model for the corresponding bin after coding eachbin. The thus coded bins may be referred to as context-coded bins.

The bypass coding engine omits a procedure of estimating the probabilityof the input bin and a procedure of updating the probability modelapplied to the corresponding bin after the coding. By coding the binwhich is input by applying the uniform probability distribution ratherthan assigning the context, it is possible to enhance a coding speed.The thus coded bins are referred to as bypass bins.

Entropy encoding may determine whether to perform the coding through theregular coding engine, or to perform the coding through the bypasscoding engine, and switch a coding path. Entropy decoding inverselyperforms the same process as in the entropy encoding.

Meanwhile, in an embodiment, the (quantized) transform coefficients maybe encoded/decoded based on syntax elements, such astransform_skip_flag, last_sig_coeff_x_prefix, last_sig_coeff_y_prefix,last_sig_coeff_x_suffix, last_sig_coeff_y_suffix, coded_sub_block_flag,sig_coeff_flag, abs_level_gt1_flag, par_level_flag, abs_level_gt3_flag,abs_remainder, dec_abs_level, coeff_sign_flag and/or mts_idx.

For example, the residual related information or the syntax elementsincluded in the residual related information may be represented as inTables 3 to 5. Alternatively, the residual coding information includedin the residual related information or the syntax elements included inthe residual coding syntax may be represented as in Tables 3 to 5.

Tables 3 to 5 may represent one syntax consecutively.

TABLE 3 Descriptor residual_coding( x0, y0, log2TbWidth, log2TbHeight,cIdx )

 if( transform_skip_enabled_flag && ( cIdx ! = 0 | | tu_mts_flag[ x0 ][y0 ] = = 0 ) &&   ( log2TbWidth <= 2 ) && ( log2TbHeight <= 2 ) )  transform_skip_flag[ x0 ][ y0 ][ cIdx ] ae(v)  last_sig_coeff_x_prefixae(v)  last_sig_coeff_y_prefix ae(v)  if( last_sig_coeff_x_prefix > 3 )  last_sig_coeff_x_suffix ae(v)  if( last_sig_coeff_y_prefix > 3 )  last_sig_coeff_y_suffix ae(v)  log2SbSize = ( Min( log2TbWidth,log2TbHeight ) < 2 ? 1 : 2 )  numSbCoeff = 1 << ( log2SbSize << 1 ) lastScanPos = numSbCoeff  lastSubBlock = ( 1 << ( log2TbWidth +log2TbHeight − 2 * log2SbSize ) ) − 1  do {   if( lastScanPos = = 0 ) {   lastScanPos = numSbCoeff    lastSubBlock− −   

  lastScanPos− −   xS = DiagScanOrder[ log2TbWidth − log2SbSize ][log2TbHeight − log2SbSize ] [ lastSubBlock ][ 0 ]   yS = DiagScanOrder[log2TbWidth − log2SbSize ][ log2TbHeight − log2SbSize ] [ lastSubBlock][ 1 ]   xC = ( xS << log2SbSize ) +     DiagScanOrder[ log2SbSize ][log2SbSize ][ lastScanPos ][ 0 ]   yC = ( yS << log2SbSize ) +    DiagScanOrder[ log2SbSize ][ log2SbSize ][ lastScanPos ][ 1 ]  }while( ( xC != LastSignificantCoeffX ) | | ( yC != LastSignificantCoeffY) )  numSigCoeff = 0  QState = 0  for( i = lastSubBlock; i >= 0; i− − ){   startQStateSb = QState   xS = DiagScanOrder[ log2TbWidth −log2SbSize ][ log2TbHeight − log2SbSize ] [ lastSubBlock ][ 0 ]   yS =DiagScanOrder[ log2TbWidth − log2SbSize ][ log2TbHeight − log2SbSize ] [lastSubBlock ][ 1 ]   inferSbDcSigCoeffFlag = 0   if( ( i < lastSubBlock) && ( i > 0 ) ) {    coded_sub_block_flag[ xS ][ yS ] ae(v)   inferSbDcSigCoeffFlag = 1   }   firstSigScanPosSb = numSbCoeff  lastSigScanPosSb = −1   remBinsPass1 = ( log2SbSize < 2 ? 6 : 28 )  remBinsPass2 = ( log2SbSize < 2 ? 2 : 4 )   firstPosMode0 = ( i == lastSubBlock ? lastScanPos − 1 : numSbCoeff − 1 )   firstPosMode1 = −1

indicates data missing or illegible when filed

TABLE 4  firstPosMode2 = −1  for( n = ( i = = firstPosMode0;n >= 0 && remBinsPass1 >= 3; n− − ) {   xC = ( xS << log2SbSize ) +DiagScanOrder[ log2SbSize ][ log2SbSize ][ n ][ 0 ]   yC = ( yS <<log2SbSize ) + DiagScanOrder[ log2SbSize ][ log2SbSize ] [ n ][ 1 ]  if( coded_sub_block_flag[ xS ][ yS ] && ( n > 0 | | 

inferSbDcSigCoeffFlag ) ) {    sig_coeff_flag[ xC ][ yC ] ae(v)   remBinsPass1− −    if( sig_coeff_flag[ xC ][ yC ] )    inferSbDcSigCoeffFlag = 0   }   if( sig_coeff_flag[ xC ][ yC ] ) {   numSigCoeff−+    abs_level_gt1_flag[ n ] ae(v)    remBinsPass1− −   if( abs_level_gt1_flag[ n ] ) {     par_level_flag[ n ] ae(v)    remBinsPass1− −     abs_level_gt3_flag[ n ] ac(v)     remBinsPass1−−    }    if( lastSigScanPosSb = = −1 )     lastSigScanPosSb = n   firstSigScanPosSb = n   }   AbsLevelPass1[ xC ][ yC ] =    sig_coeff_flag[ xC ][ yC ] + par_level_flag[ n ] +abs_level_gt1_flag[ n ] + 2 * abs_level_gt3_flag[ n ]   if(dep_quant_enabled_flag )    QState = QStateTransTable[ QState ][AbsLevelPass1[ xC ][ yC ] & 1 ]   if( remBinsPass1< 3 )    firstPosMode2= n − 1  }  for( n = numSbCoeff − 1; n >= firstPosMode2; n− − ) {   xC =( xS << log2SbSize ) + DiagScanOrder[ log2SbSize ][ log2SbSize ][ n ][ 0]   yC = ( yS << log2SbSize ) + DiagScanOrder[ log2SbSize ][ log2SbSize][ n ][ 1 ]   if( abs_level_gt3_flag[ n ] )    abs_remainder[ n ] ae(v)  AbsLevel[ xC ][ yC ] = AbsLevelPass1[ xC ][ yC ] + 2 * abs_remainder[n ]  }  for( n = firstPosMode2; n >= 0; n− − } (   xC = ( xS <<log2SbSize ) + DiagScanOrder[ log2SbSize ][ log2SbSize ][ n ][ 0 ]   yC= ( yS << log2SbSize ) + DiagScanOrder[l og2SbSize ][ log2SbSize ][ n ][1 ]   dec_abs_level[ n ] ae(v)   if(AbsLevel[ xC ][ yC ] > 0 )   firstSigScanPosSb = n   if( dep_quant_enabled_flag )

indicates data missing or illegible when filed

TABLE 5     QState = QStateTransTable[ QState ][ AbsLevel[ xC ][ yC ] &1 ]   }   if( dep_quant_enabled_flag | | 

sign_data_hiding_enabled_flag )    signHidden = 0   else    signHidden =( lastSigScanPosSb − firstSigScanPosSb > 3 ? 1 : 0 )   for( n =numSbCoeff − 1; n >= 0; n− − ) {    xC = ( xS << log2SbSize ) +DiagScanOrder[ log2SbSize ][ log2SbSize ][ n ][ 0 ]    yC = ( yS <<log2SbSize ) + DiagScanOrder[ log2SbSize ][ log2ShSize ][ n ][ 1 ]   if( sig_coeff_flag[ xC ][ yC ] &&     ( !signHidden | | (n != firstSigScanPosSb ) ) ) ae(v)     coeff_sign_flag[ n ]   }   if(dep_quant_enabled_flag ) {    QState = startQStateSb    for( n =numSbCoeff − 1; n >= 0; n− − ) {     xC = ( xS << log2SbSize ) −      DiagScanOrder[ log2SbSize ][ log2SbSize ][ n ][ 0 ]     yC = ( yS<< log2SbSize ) −       DiagScanOrder[ log2SbSize ][ log2SbSize ][ n ][1 ]     if( sig_coeff_flag[ xC ][ yC ] )      TransCoeffLevel[ x0 ][ y0][ cIdx ][ xC ][ yC ] =        ( 2 * AbsLevel[ xC ][ yC ] − ( QState > 1? 1 : 0 ) ) *        ( 1 − 2 * coeff_sign flag[ n ] )     QState =QStateTransTable[ QState ][ par_level_flag[ n ] ]   } else {   sumAbsLevel = 0    fort n = numSbCoeff − 1; n >= 0: n− − ) {     xC =( xS << log2SbSize ) −       DiagScanOrder[ log2SbSize ][ log2SbSize ][n ][ 0 ]     yC = ( yS << log2SbSize ) −       DiagScanOrder[ log2SbSize][ log2SbSize ][ n ][ 1 ]     if( sig_coeff_flag[ xC ][ yC ] ) {     TransCoeffLevel[ x0 ][ y0 ][ cIdx ][ xC ][ yC ] =        AbsLevel[xC ][ yC ] * ( 1 − 2 * coeff_sign_flag[ n ] )      if( signhidden ) 

      sumAbsLevel += AbsLevel[ xC ][ yC ]       if( ( n == firstSigScanPosSb } && ( sumAbsLevel % 2 ) = = 1 ) )       TransCoeffLevel[ x0 ][ y0 ][ cIdx ][ xC ][ yC ] =        −TransCoeffLevel[ x0 ][ y0 ][ cIdx ][ xC ][ yC ]      }     }   }   }  }  if( tu_mts_flag[ x0 ][ y0 ] && ( cIdx = = 0 ) )   mts_idx[x0 ][ y0 ][ cIdx ] ae(v) }

indicates data missing or illegible when filed

For example, the residual related information may include the residualcoding information (or syntax elements included in the residual codingsyntax) or the transform unit information (or syntax elements includedin the transform unit syntax), the residual coding information may berepresented as in Tables 6 to 9, and the transform unit information maybe represented as in Table 10 or Table 11. Tables 6 to 9 may representone syntax consecutively.

TABLE 6 Descriptor residual_coding( x0, y0, log2TbWidth, log2TbHeight,cIdx ) {  if( sps_mts_enabled_flag && cu_sbt_flag && cIdx = = 0 &&   log2TbWidth = = 5 && log2TbHeight < 6 )   log2ZoTbWidth = 4  else  log2ZoTbWidth = Min( log2TbWidth, 5 )  if( sps_mts_enabled_flag &&cu_sbt_flag && cIdx = = 0 &&    log2TbWidth < 6 && log2TbHeight = = 5 )  log2ZoTbHeight = 4  else   log2ZoTbHeight = Min( log2TbHeight, 5 ) if( log2TbWidth > 0 )   last_sig_coeff_x_prefix ae(v)  if(log2TbHeight > 0 )   last_sig_coeff_y_prefix ae(v)  if(last_sig_coeff_x_prefix > 3 )   last_sig_coeff_x_suffix ae(v)  if(last_sig_coeff_y_prefix > 3 )   last_sig_coeff_y_suffix ae(v) log2TbWidth = log2ZoTbWidth  log2TbHeight = log2ZoTbHeight  remBinsPass

 = ( ( 1 << ( log2TbWidth + log2TbHeight ) ) * 7 ) >> 2  log2SbW = (Min( log2TbWidth, log2TbHeight ) < 2 ? 1 : 2 )  log2SbH = log2SbW  if(log2TbWidth + log2TbHeight > 3 ) {   if( log2TbWidth < 2 ) {     log2ShW= log2TbWidth     log2SbH = 4 − log2SbW    } else if( log2TbHeight < 2 ){     log2SbH = log2TbHeight     log2SbW = 4 − log2SbH    }  } numSbCoeff = 1 << ( log2SbW + log2SbH )  lastScanPos = numSbCoeff lastSubBlock = ( 1 << ( log2TbWidth + log2TbHeight − ( log2SbW −log2SbH ) ) ) − 1  do {   if( lastScanPos = = 0 ) {     lastScanPos =numSbCoeff     lastSubBlock− −    }   lastScanPos− −   xS =DiagScanOrder[ log2TbWidth − log2SbW ][ log2TbHeight − log2SbH ] [lastSubBlock ][ 0 ]   yS = DiagScanOrder[ log2TbWidth − log2SbW ][log2TbHeight − log2SbH ] [ lastSubBlock ][ 1 ]   xC = ( xS << log2SbW) + DiagScanOrder[ log2SbW ][ log2SbH ][ lastScanPos ][ 0 ]

indicates data missing or illegible when filed

TABLE 7  yC = ( yS << log2SbH ) + DiagScanOrder[ log2SbW ][ log2SbH ][lastScanPos ][ 1 ] } while( ( xC != LastSignificantCoeffX ) | | ( yC !=LastSignificantCoeffY ) ) if( lastSubBlock = = 0 && log2TbWidth >= 2 &&log2TbHeight >= 2 &&  !transform_skip_flag[ x0 ][ y0 ][ cIdx ] &&lastScanPos > 0 )  LfnstDcOnly = 0 if( ( lastSubBlock > 0 &&log2TbWidth >= 2 && log2TbHeight >= 2 ) | |  ( lastScanPos > 7 && (log2TbWidth = = 2 | | log2TbWidth = = 3 ) &&  log2TbWidth = =log2TbHeight ) )  LfnstZeroOutSigCoeffFlag = 0 if( (LastSignificantCoeffX > 15 | | LastSignificantCoeffY > 15 ) && cIdx = =0 )  MtsZeroOutSigCoeffFlag = 0 QState = 0 for( i = lastSubBlock; i >=0; i− − ) {  startQStateSb = QState  xS = DiagScanOrder[ log2TbWidth −log2SbW ][ log2TbHeight − log2SbH ] [ i ][ 0 ]  yS = DiagScanOrder[log2TbWidth − log2SbW ][ log2TbHeight − log2SbH ] [ i ][ 1 ] inferSbDcSigCoeffFlag = 0  if( i < lastSubBlock && i > 0 ) {  coded_sub_block_flag[ xS ][ yS ] ae(v)   inferSbDcSigCoeffFlag =

 }  firstSigScanPosSb = numSbCoeff  lastSigScanPosSb = −1  firstPosMode0= ( i == lastSubBlock ? lastScanPos : numSbCoeff − 1 )  firstPosMode1 =firstPosMode0  for( n = firstPosMode0; n >= 0 && remBinsPass1 >= 4; n− −) {   xC = ( xS << log2SbW ) + DiagScanOrder[ log2SbW ][ log2SbH ][ n ][0 ]   yC = ( yS << log2SbH ) + DiagScanOrder[ log2SbW ][ log2SbH ][ n ][1 ]   if( coded_sub_block_flag[ xS ][ yS ] && ( n > 0 | |

inferSbDcSigCoeffFlag ) &&    ( xC != LastSignificantCoeffX | | yC !=Last SignificantCoeffY ) ) }    sig_coeff_flag[ xC ][ yC ] ae(v)   remBinsPass1 − −    if( sig_coeff_flag[ xC ][ yC ] )    inferSbDcSigCoeffFlag = 0   

  if( sig_coeff_flag[ xC ][ yC ] ) {    abs_level_gtx_flag[ n ][ 0 ]ae(v)    remBinsPass1− −    if( abs_level_gtx_flag[ n ][ 0 ] ) {    par_level_flag[ n ] ae(v)     remBinsPass1− −    abs_level_gtx_flag[ n ][ 1 ] ae(v)     remBinsPass1− −    }    if(lastSigScanPosSb = = −1 )     lastSigScanPosSb = n    firstSigScanPosSb= n   }

indicates data missing or illegible when filed

TABLE 8  AbsLevelPass1[ xC ][ yC ] = sig_coeff_flag[ xC ][ yC ] +par_level_flag[ n ] +      abs_level_gtx_flag[ n ][ 0 ] − 2 *abs_level_gtx_flag[ n ][ 1 ]  if( pic_dep_quant_enabled_flag )   QState= QStateTransTable[ QState ][ n ][ AbsLevelPass1[ xC ][ yC ] & 1 ] firstPosMode1 = n − 1 } for( n = firstPosMode0; n > firstPosMode1; n− −) {  xC = ( xS << log2SbW ) + DiagScanOrder[ log2SbW ][ log2SbH ][ n ][0 ]  yC = ( yS << log2SbH ) − DiagScanOrder[ log2SbW ][ log2SbH ][ n ][1 ]  if( abs_level_gtx_flag[ n ][ 1 ] )   abs_remainder[ n ] ae(v) AbsLevel[ xC ][ yC ] = AbsLevelPass1[ xC ][ yC ] +2 * abs_remainder[ n] } for( n = firstPosMode1; n >= 0; n− − ) {  xC = ( xS << log2SbW ) +DiagScanOrder[ log2SbW ][ log2SbH ][ n ][ 0 ]  yC = ( yS << log2SbH ) −DiagScanOrder[ log2SbW ][ log2SbH ][ n ][ 1 ]  if( coded_sub_block_flag[xS ][ yS ] )   dec_abs_level[ n ] ae(v)  if( AbsLevel[ xC ][ yC ] > 0 ){   if( lastSigScanPosSb = = −1 )    lastSigScanPosSb = n  firstSigScanPosSb = n  }  it(pic_dep_quant_enabled_flag )   QState =QStateTransTable[ QState ][ AbsLevel[ x ][ yC ] & 1 ] } if(pic_dep_quant_enabled_flag | | !sign_data_hiding_enabled_flag ) signHidden = 0 else  signHidden = ( lastSigScanPosSb −firstSigScanPosSb > 3 ? 1 : 0 ) for( n = numSbCoeff − 1; n >= 0; n− − ){  xC = ( xS << log2SbW) + DiagScanOrder[ log2SbW ][ log2SbH ][ n ][ 0 ] yC = ( yS << log2SbH ) − DiagScanOrder[ log2SbW ][ log2SbH ][ n ][ 1 ] if( ( AbsLevel[ xC ][ yC ] > 0 ) &&   ( !signHidden | | ( n !=firstSigScanPosSb ) ) )   coeff_sign_flag[ n ] ae(v) } if(pic_dep_quant_enabled_flag ) {  QState = startQStateSb  for( n =numSbCoeff − 1; n >= 0; n− − ) {   xC = ( xS << log2SbW ) +DiagScanOrder[ log2SbW ][ log2SbH ][ n ][ 0 ]   yC = ( yS << log2SbH ) +DiagScanOrder[ log2SbW ][ log2SbH ][ n ][ 1 ]   if( AbsLevel[ xC ][ yC] > 0 )    TransCoeffLevel[ x0 ][ y0 ][ cIdx ][ xC ][ yC ] =     ( 2 *AbsLevel[ xC ][ yC ] − ( QState > 1 ? 1 : 0 ) ) *     ( 1 − 2 *coeff_sign_flag[ n ] )   QState = QStateTransTable[ QState ][ AbsLevel[xC ][ yC ] & 1 ] } else {  sumAbsLevel = 0

TABLE 9   for( n = numSbCoeff − 1; n >= 0; n− − ) {    xC = ( xS <<log2SbW ) + DiagScanOr-    der[ log2SbW ][ log2SbH ][ n ][ 0 ]    yC = (yS << log2SbH ) + DiagScanOr-    der[ log2SbW ][ log2SbH ][ n ][ 1 ]   if( AbsLevel[ xC ][ yC ] > 0 ) {     TransCoeffLevel[ x0 ][ y0 ][cIdx ][ xC ][ yC ] =       AbsLevel[ xC ][ yC ] * ( 1 − 2 *coeff_sign_flag[ n ] )     if( signHidden ) {      sumAbsLevel +=AbsLevel[ xC ][ yC ]      if( ( n = = firstSigScanPosSb ) && (sumAbsLevel % 2 ) = =      1 ) )       TransCoeffLevel[ x0 ][ y0 ][ cIdx][ xC ][ yC ] =        −TransCoeffLevel[ x0 ][ y0 ][ cIdx ][ xC ][ yC ]    }    }   }  } }

TABLE 10 Descriptor transform_unit( x0, y0, tbWidth, tbHeight, treeType,subTuIndex ) {  if( ( treeType = = SINGLE_TREE | | TreeType = =DUAL_TREE_CHROMA ) &&      ChromaArrayType != 0 ) {   if( (IntraSubPartitionsSplitType = = ISP_NO_SPLIT && !( cu_sbt_flag &&      (( subTuIndex = = 0 && cu_sbt_pos_flag ) | |       ( subTuIndex = = 1 &&!cu_sbt_pos_flag ) ) ) ) | |    ( IntraSubPartitionsSplitType !=ISP_NO_SPLIT &&     ( subTuIndex = = NumIntraSubPartitions − 1 ) ) ) {   tu_cbf_cb[ x0 ][ y0 ] ae(v)    tu_cbf_cr[ x0 ][ y0 ] ae(v)   }  } if( treeType = = SINGLE_TREE | | treeType = = DUAL_TREE_LUMA ) {   if(( IntraSubPartitionsSplitType = = ISP_NO_SPLIT && !( cu_sbt_flag &&     ( ( subTuIndex = = 0 && cu_sbt_pos_flag ) | |       ( subTuIndex == 1 && !cu_sbt_pos_flag ) ) ) &&      ( CuPredMode[ x0 ][ y0 ] = =MODE_INTRA | |       tu_cbf_cb[ x0 ][ y0 ] | | tu_cbf_cr[ x0 ][ y0 ] | |      CbWidth[ x0 ][ y0 ] > MaxTbSizeY | CbHeight[ x0 ][ y0 ] >MaxTbSizeY ) ) |    ( IntraSubPartitionsSplitType != ISP_NO_SPLIT &&   ( subTuIndex < NumIntraSubPartitions − 1 | | !InferTuCbfLuma ) ) )   tu_cbf_luma[ x0 ][ y0 ] ae(v)   if (IntraSubPartitionsSplitType !=ISP_NO_SPLIT )    InferTuCbfLuma = InferTuCbfLuma && !tu_cbf_luma[ x0 ][y0 ]  } ...  if( ( tu_cbf_luma[ x0 ][ y0 ] | | tu_cbf_cb[ x0 ][ y0 ] | tu_cbf_cr[ x0 ][ y0 ] ) &&   treeType != DUAL_TREE_CHROMA ) {   if(cu_qp_delta_enabled_flag && !IsCuQpDeltaCoded ) (    cu_qp_delta_absae(v)    if( cu_qp_delta_abs )      cu_qp_delta_sign_flag ae(v)   }  } if( tu_cbf_luma[ x0 ][ y0 ] && treeType != DUAL_TREE_CHROMA   && (tbWidth <= 32 ) && ( tbHeight <= 32 )   && ( IntraSubPartitionsSplit[ x0][ y0 ] = = ISP_NO_SPLIT ) && ( !cu_sbt_flag ) ) {   if(transform_skip_enabled_flag && tbWidth <= MaxTsSize && tbHeight <=MaxTsSize )    transform_skip_flag[ x0 ][ y0 ] ae(v)   if( ((CuPredMode[ x0 ][ y0 ] != MODE_INTRA &&sps_explicit_mts_inter_enabled_flag )      ( CuPredMode[ x0 ][ y0 ] = =MODE_INTRA && sps_explicit_mts_intra_enabled_flag ))    && (!transform_skip_flag[ x0 ][ y0 ] ) )    tu_mts_idx[ x0 ][ y0 ] ae(v) ...

TABLE 11 Descriptor transform_unit( x0, y0, tbWidth, tbHeight, treeType,subTuIndex, chType ) { ...  if( tu_cbf_luma[ x0 ][ y0 ] && treeType !=DUAL_TREE_CHROMA ) {   if( sps_transform_skip_enabled_flag &&!BdpcmFlag[ x0 ][ y0 ][ 0 ] &&    tbWidth <= MaxTsSize && tbHeight <=MaxTsSize &&    ( IntraSubPartitionsSplit[ x0 ][ y0 ] = = ISP_NO_SPLIT )&& !cu_sbt_flag )    transform_skip_flag[ x0 ][ y0 ][ 0 ] ae(v)   if(!transform_skip_flag[ x0 ][ y0 ][ 0 ] )    residual_coding( x0, y0,Log2( tbWidth ), Log2( tbHeight ), 0 )   else    residual_ts_coding( x0,y0, Log2( tbWidth ), Log2( tbHeight ), 0 )  }  if( tu_cbf_cb[ xC ][ yC ]&& treeType != DUAL_TREE_LUMA ) {   if( sps_transform_skip_enabled_flag&& !BdpcmFlag[ x0 ][ y0 ][ 1 ] &&    wC <= MaxTsSize && hC <= MaxTsSize&& !cu_sbt_flag )    transform_skip_flag[ xC ][ yC ][ 1 ] ae(v)   if(!transform_skip_flag[ xC ][ yC ][ 1 ] )    residual_coding( xC, yC,Log2( wC ), Log2( hC ), 1 )   else    residual_ts_coding( xC, yC, Log2(wC ), Log2( hC ), 1 )  }  if( tu_cbf_cr[ xC ][ yC ] && treeType !=DUAL_TREE_LUMA &&   !( tu_cbf_cb[ xC ][ yC ] &&tu_joint_cbcr_residual_flag[ xC ][ yC ] ) ) {   if(sps_transform_skip_enabled_flag && !BdpcmFlag[ x0 ][ y0 ][ 2 ] &&    wC<= MaxTsSize && hC <= MaxTsSize Se& !cu_sbt_flag )   transform_skip_flag[ xC ][ yC ][ 2 ] ae(v)   if(!transform_skip_flag[ xC ][ yC ][ 2 ] )    residual_coding( xC, yC,Log2( wC ), Log2( hC ), 2 )   else    residual_ts_coding( xC, yC, Log2(wC ), Log2( hC ), 2 )  } }

The syntax element transform_skip_flag represents whether the transformfor an associated block is omitted. The associated block may be a codingblock (CB) or a transform block (TB). With regard to the transform (andquantization) and residual coding procedures, the CB and TB may be usedinterchangeably. For example, as described above, the residual sampleswith respect to the CB may be derived, and the (quantized) transformcoefficients may be derived through the transform and the quantizationfor the residual samples, and information (for example, syntax elements)efficiently representing the position, size, sign, and the like of the(quantized) transform coefficients may be generated and signaled throughthe residual coding procedure. The quantized transform coefficients maybe simply referred to as transform coefficients. Generally, when the CBis not greater than the maximum TB, the size of the CB may be equal tothe size of the TB, and in this case, a target block to be transformed(and quantized) and residual coded may be referred to as CB or TB.Meanwhile, when the CB is greater than the maximum TB, the target blockto be transformed (and quantized) and residual coded may be referred toas TB. Hereinafter, while it will be described that the syntax elementsrelated to the residual coding are signaled in units of transform block(TB), this is illustrative and the TB may be used interchangeably withthe coding block (CB) as described above.

In Tables 3 to 5, while it has been illustrated that the syntax elementtransform_skip_flag is signaled based on the residual coding syntax,this is illustrative, and the syntax element transform_skip_flag mayalso be signaled based on the transform unit syntax as illustrated inTable 10 or Table 11. The residual coding syntax and the transform unitsyntax may be collectively referred to as the residual (related)information. For example, the syntax element transform_skip_flag may besignaled only for the luma component (luma component block) (see Table10). Specifically, for example, when a non-zero significant coefficientexists in the luma component block, the residual related information mayinclude the transform skip flag (transform_skip_flag) for the lumacomponent block. In this case, the residual related information does notinclude the transform skip flag for the chroma component block. That is,the residual related information may include the transform skip flag forthe luma component block, and may not include the transform skip flagfor the chroma component block. That is, in this case, the transformskip flag for the chroma component block is not explicitly signaled, andthe value of the transform skip flag for the chroma component block maybe derived/inferred to 0.

Alternatively, as another example, the syntax elementtransform_skip_flag may also be signaled for the luma component (lumacomponent block) and the chroma component (chroma component block),respectively (see Table 11).

Referring back to Tables 3 to 5 or Tables 6 to 9, an embodiment may code(x, y) position information of the last non-zero transform coefficientwithin the transform block based on the syntax elementslast_sig_coeff_x_prefix, last_sig_coeff_y_prefix,last_sig_coeff_x_suffix, and last_sig_coeff_y_suffix. More specifically,the syntax element last_sig_coeff_x_prefix represents the prefix of thecolumn position of the last significant coefficient in the scanningorder within the transform block, the syntax elementlast_sig_coeff_y_prefix represents the prefix of the row position of thelast significant coefficient in the scanning order within the transformblock, the syntax element last_sig_coeff_x_suffix represents the suffixof the column position of the last significant coefficient in thescanning order within the transform block, and the syntax elementlast_sig_coeff_y_suffix represents the suffix of the row position of thelast significant coefficient in the scanning order within the transformblock. Here, the significant coefficient may represent the non-zerocoefficient. The scanning order may be an up-right diagonal scanningorder. Alternatively, the scanning order may be a horizontal scanningorder or a vertical scanning order. The scanning order may be determinedbased on whether the intra/inter prediction is applied to the targetblock (CB, or CB including TB) and/or a specific intra/inter predictionmode.

Next, after the transform block is split into 4×4 sub-blocks, whetherthe non-zero coefficient exists within a current sub-block by using a1-bit syntax element coded_sub_block_flag every 4×4 sub-block. Thesub-block may be used interchangeably with a Coefficient Group (CG).

When a value of the syntax element coded_sub_block_flag is 0, there isno more information to be transmitted, such that the coding process forthe current sub-block may be terminated. Conversely, when the value ofthe syntax element coded_sub_block_flag is 1, the coding process for thesyntax element sig_coeff_flag may be continuously performed. Since thesub-block including the last non-zero coefficient does not require thecoding for the syntax element coded_sub_block_flag, and the sub-blockincluding DC information of the transform block has a high probabilityof including the non-zero coefficient, the value of the syntax elementcoded_sub_block_flag may be assumed to be 1 without being coded.

If the value of the syntax element coded_sub_block_flag is 1 and it isdetermined that the non-zero coefficient exists within the currentsub-block, the syntax element sig_coeff_flag having a binary value maybe coded according to the inversely scanned order. A 1-bit syntaxelement sig_coeff_flag may be coded for each coefficient according tothe scanning order. If the value of the transform coefficient at thecurrent scanning position is not 0, the value of the syntax elementsig_coeff_flag may be 1. Here, in the case of the sub-block includingthe last non-zero coefficient, the coding process for the sub-block maybe omitted because it is not necessary to code the syntax elementsig_coeff_flag with respect to the last non-zero coefficient. Levelinformation coding may be performed only when the syntax elementsig_coeff_flag is 1, and four syntax elements may be used in the levelinformation coding process. More specifically, each syntax elementsig_coeff_flag [xC] [yC] may represent whether the level (value) of thecorresponding transform coefficient at each transform coefficientposition (xC, yC) within the current TB is non-zero. In an embodiment,the syntax element sig_coeff_flag may correspond to an example of asignificant coefficient flag representing whether the quantizedtransform coefficient is a non-zero significant coefficient.

The remaining level value after the coding for the syntax elementsig_coeff_flag may be as is expressed in Equation 1 below. That is, asyntax element remAbsLevel representing the level value to be coded maybe as is expressed in Equation 1 below. Here, coeff may mean an actualtransform coefficient value.

remAbsLevel=|coeff|−1  Equation 1

The syntax element abs_level_gt1_flag may represent whether theremAbsLevel′ at the corresponding scanning position (n) is greaterthan 1. When a value of the abs_level_gt1_flag is 0, the absolute valueof the coefficient of the corresponding position may be 1. When thevalue of the abs_level_gt1_flag is 1, the level value remAbsLevel to becoded later may be as is expressed in Equation 2 below.

remAbsLevel=remAbsLevel−1  Equation 2

As in Equation 3 below through the syntax element par_level_flag, theleast significant coefficient (LSB) value of the remAbsLevel describedin Equation 2 may be coded. Here, the syntax element par_level_flag [n]may represent a parity of the transform coefficient level (value) at thescanning position (n). The transform coefficient level value remAbsLevelto be coded after the coding of the syntax element par_level_flag may beupdated as is expressed in Equation 4 below.

par_level_flag=remAbsLevel &1  Equation 3

rernAbsLevel′=remAbsLevel>>1  Equation 4

The syntax element abs_level_gt3_flag may represent whether theremAbsLevel′ at the corresponding scanning position (n) is greater than3. Coding of the syntax element abs_remainder may be performed only whenthe syntax element abs_level_gt3_flag is 1. The relationship between thecoeff, which is the actual transform coefficient value, and therespective syntax elements may be summarized as is expressed in Equation5 below, and Table 12 below may represent examples related to Equation5. Finally, the sign of each coefficient may be coded by using thesyntax element coeff_sign_flag, which is a 1-bit symbol. |coeff| mayrepresent the transform coefficient level (value), and may also beexpressed as AbsLevel for the transform coefficient.

|coeff|=sig_coeff_flag+abs_level_gt1_flag+par_level_flag+2*(abs_evel_gt3_flag+abs_remainder)  Equation5

TABLE 12 abs_remainder/ |coeff| sig_coeff_flag abs_level_gt1_flagpar_level_flag abs_level_gt3_flag dec_abs_level 0 0 1 1 0 2 1 1 0 3 1 11 0 4 1 1 0 1 0 5 1 1 1 1 0 6 1 1 0 1 1 7 1 1 1 1 1 8 1 1 0 1 2 9 1 1 11 2 10 1 1 0 1 3 11 1 1 1 1 3 . . . . . . . . . . . .

In an embodiment, the par_level_flag may represent an example of aparity level flag for the parity of the transform coefficient level forthe quantized transform coefficient, the abs_level_gt1_flag mayrepresent an example of a first transform coefficient level flag aboutwhether the transform coefficient level or the level (value) to be codedis greater than a first threshold, and the abs_level_gt3_flag mayrepresent an example of a second transform coefficient level flag aboutwhether the transform coefficient level or the level (value) to be codedis greater than a second threshold.

FIG. 9 is a diagram illustrating an example of transform coefficientswithin a 4×4 block.

The 4×4 block illustrated in FIG. 9 may represent an example ofquantized coefficients. The block illustrated in FIG. 9 may be a 4×4transform block, or a 4×4 sub-block of 8×8, 16×16, 32×32, and 64×64transform blocks. The 4×4 block illustrated in FIG. 9 may represent aluma block or a chroma block. Coding results for the inverse diagonallyscanned coefficients illustrated in FIG. 9 may be represented, forexample, as in Table 13. In Table 13, the scan_pos may represent theposition of the coefficient according to the inverse diagonal scan. Thescan_pos 15 may represent the coefficient which is first scanned, thatis, of the lower right corner in the 4×4 block, and the scan_pos 0 mayrepresent the coefficient, which is lastly scanned, that is, of theupper left corner in the 4×4 block. Meanwhile, in an embodiment, thescan_pos may also be referred to as a scan position. For example, thescan_pos 0 may be referred to as a scan position 0.

TABLE 13 scan_pos 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 coefficients 0 00 0 1 −1 0 2 0 3 −2 −3 4 6 −7 10 sig_coeff_flag 0 0 0 0 1 1 0 1 0 1 1 11 1 abs_level_gt1_flag 0 0 1 1 1 1 1 1 par_level_flag 0 1 0 1 0 0abs_level_gt3_flag 1 1 abs_remainder 0 1 dec_abs_level 7 10coeff_sign_flag 0 0 0 0 0 1 0 0 0 0 1 1 0 0 1 0

Meanwhile, CABAC provides high performance but has a disadvantage ofpoor throughput performance. This is caused by the regular coding engineof the CABAC, and the regular coding uses the updated probability stateand range through the coding of the previous bin, thereby showing highdata dependency, and taking a long time to read the probability sectionand determine the current state. It is possible to solve the throughputproblem of the CABAC by limiting the number of context-coded bins.

Accordingly, the sum of bins used to express the syntax elementssig_coeff_flag, abs_level_gt1_flag, and par_level_flag is restricted to28 in the case of the 4×4 sub-block, and restricted to 6 (remBinsPass1)in the case of the 2×2 sub-block according to the size of the sub-blockas in Tables 3 to 5 or Tables 6 to 9, and the number of context-codedbins of the syntax element abs_level_gt3_flag may be restricted to 4 inthe case of the 4×4 sub-block and restricted to 2 (remBinsPass2) in thecase of the 2×2 sub-block. When all of the restricted context-coded binsare used to code the context element, the remainder coefficients may bebinarized without using the CABAC to perform the bypass coding.

Meanwhile, an embodiment of the present document may propose a unifiedtransform type signaling method.

For example, information about whether to apply the MTS may berepresented by the tu_mts_flag syntax element, and information about thetransform kernel to be applied may be represented by the mts_idx syntaxelement. In addition, the tu_mts_flag syntax element may be included inthe transform unit syntax, and the mts_idx syntax element may beincluded in the residual coding syntax, and may be represented, forexample, as in Tables 14 and 15.

TABLE 14 transform_unit( ) ...  tu_cbf_luma ...  if( ... tu_cbf_luma &&( tbWidth <= 32 ) && ( tbHeight <= 32) ... )   tu_mts_flag ...

TABLE 15 residual_coding(cIdx) ...  if(( cIdx ! = 0 || ! tu_mts_flag )&& ( log2TbWidth <= 2 ) && (log2TbHeight <= 2 ))  transform_skip_flag[cIdx] .../*coefficient parsing */...  if(tu_mts_flag && cIdx == 0 )   mts_idx ...

However, an embodiment of the present document is the unified transformtype signaling, and may represent the information about whether to applythe MTS and the information about the transform kernel to be applied byusing only one piece of information. For example, the one piece ofinformation may also be represented by information about the unifiedtransform type, and may also be represented by a tu_mts_idx syntaxelement. In this case, the tu_mts_flag syntax element and the mts_idxsyntax element may be omitted. The tu_mts_idx syntax element may beincluded in the transform unit syntax, and may be represented, forexample, as in Table 16.

TABLE 16 transform_unif( ) ...  tu_cbf_luma ...  if( ... tu_cbf_luma &&( tbWidth <= 32 ) && ( tbHeight <= 32) ... )   tu_mts_idx ...

The MTS flag (or tu_mts_flag syntax element) is parsed first, and forthe Transform Skip (TS) flag (or transform_skip_flag syntax element)followed by the MTS index (or mts_idx syntax element), the tu_mts_idxsyntax element, which is a new joint syntax element using TruncatedUnary (TU) binarization according to an embodiment of the presentdocument, may be used, instead of performing a fixed length codinghaving two bins. A first bin may represent the TS, the second MTS, andall of the following MTS indexes.

For example, the semantics and binarization of the tu_mts_idx syntaxelement may be represented as in Table 17 or Table 18.

TABLE 17 binarization Tranform type MTS & TS MTS TS tu_mts_idxhorizontal vertical enabled enabled enabled 0 DCT-II DCT-II   0   0 0 1SKIP SKIP  10 — 1 2 DST-VII DST-VII  110  10 — 3 DCT-VIII DST-VII 1110 110 — 4 DST-VII DCT-VIII 11110  1110 — 5 DCT-VIII DCT-VIII 11111  1111—

TABLE 18 binarization Tranform type MTS & TS MTS TS tu_mts_idxhorizontal vertical enabled enabled enabled 0 SKIP SKIP   0   0 0 1DCT-II DCT-II  10 — 1 2 DST-VII DST-VII  110  10 — 3 DCT-VIII DST-VII1110  110 — 4 DST-VII DCT-VIII 11110  1110 — 5 DCT-VIII DCT-VIII 11111 1111 —

For example, the number of context models may not be changed, and theassignment of ctxInc, which is a context index increment for each bin ofthe tu_mts_idx syntax element, may be represented as in Table 19.

TABLE 19 Syntax binIdx element 0 1 2 3 4 >=5 tu_mts_idx 0 1 . . . 6 7 89 na (MTS & TS) (1 + cqtDepth) tu_mts_idx 1...6 7 8 9 na na (MTS) (1 +cqtDepth) tu_mts_idx 0 na na na na na (TS)

Meanwhile, an embodiment of the present document may propose a residualcoding method for the transform skip.

For example, the following items may be modified to adapt the residualcoding to the statistics and signal characteristics of the transformskip level representing a quantized prediction residual (spatialdomain).

(1) No last significant scanning position: since the residual signalreflects the spatial residual after prediction, and energy compaction bythe transform is not performed for the Transform Skip (TS), a highprobability for trailing zeros or insignificant levels may no longer beprovided in the bottom-right corner of the transform block. Accordingly,the signaling of the last significant scanning position may be omitted.Instead, a first sub-block to be processed may be the most bottom-rightsub-block within the transform block.

(2) Sub-block CBFs: due to the absence of the signaling of the lastsignificant scanning position, the sub-block CBF signaling having thecoded_sub_block_flag syntax element for the TS may be modified asfollows.

-   -   Due to the quantization, the aforementioned insignificant        sequence may still occur locally within the transform block.        Accordingly, the last significant scanning position may be        eliminated as described above, and the coded_sub_block_flag        syntax element may be coded for all of the sub-blocks.    -   The coded_sub_block_flag syntax element for the sub-block        (top-left sub-block) covering a DC frequency position may be        represented as a special case. For example, the        coded_sub_block_flag syntax element for the corresponding        sub-block is not signaled and may always be inferred as 1. When        the last significant scanning position is positioned in another        sub-block, it may mean that there is at least one significant        level outside the DC sub-block (sub-block covering the DC        frequency position). As a result, for the DC sub-block, it is        inferred that the value of the coded_sub_block_flag syntax        element for the corresponding sub-block is 1 but may include        only 0/insignificant level. When there is no last scanning        position information in the TS, the coded_sub_block_flag syntax        element for each sub-block may be signaled. This may include the        coded_sub_block_flag syntax element for the DC sub-block, except        for the case where the values of all other coded_sub_block_flag        syntax elements are already 0. In this case, the value of the        coded_sub_block_flag syntax element for the DC sub-block may be        inferred as 1 (inferDcSbCbf=1). Since this DC sub-block needs to        have at least one significant level, instead of the value of all        other sig_coeff_flag syntax elements within the DC sub-block        being 0, the sig_coeff_flag syntax element for the first        position (0, 0) may not be signaled, and the value of the        sig_coeff_flag syntax element may be derived as 1        (inferSbDcSigCoeffFlag=1).    -   Context modeling for the coded_sub_block_flag syntax element may        be changed. The context model index may be calculated by the sum        of the coded_sub_block_flag syntax element of the right and the        coded_sub_block_flag syntax element of the bottom instead of the        current sub-block and the logical disjunction of the two.

(3) Context modeling of the sig_coeff_flag syntax element: the localtemplate of the context modeling of the sig_coeff_flag syntax elementmay be modified to include the right neighbor (NB₀) and the bottomneighbor (NB₁) of the current scanning position. A context model offsetmay be the number of significant neighbor positions sig_coeff_flag[NB₀]+sig_coeff_flag [NB₁]. Accordingly, selection of other context setsmay be eliminated according to the diagonal (d) within the currenttransform block. This may cause three context models and single contextmodel set for coding the sig_coeff_flag syntax element.

(4) Context modeling of the abs_level_gt1_flag syntax element and thepar_level_flag syntax element: the single context model may be used forthe abs_level_gt1_flag syntax element and the par_level_flag syntaxelement.

(5) Coding of the abs_remainder syntax element: generally, the empiricaldistribution of the transform skip residual absolute levels is stillsuitable for a laplacian or a geometric distribution, but instationarity, which is greater than the transform coefficient absolutelevels, may exist. Particularly, the variance within the window ofcontinuous realization may be higher for the residual absolute levels.Accordingly, the binarization and context modeling of the abs_remaindersyntax element may be modified as follows.

-   -   From using a higher cutoff value for binarization, that is, the        coding used for the sig_coeff_flag syntax element, the        abs_level_gt1_flag syntax element, the par_level_flag syntax        element, and the abs_level_gt3_flag syntax element, the        dedicated context models for the transition point to a rice code        for the abs_remainder syntax element and the position of each        bin may cause higher compaction efficiency. An increase in the        cutoff may cause a flag “greater than X”, for example, such as        introducing the abs_level_gt5_flag syntax element and the        abs_level_gt7_flag syntax element until reaching the cutoff. The        cutoff itself may be fixed to 5 (numGtFlags=5).    -   The template for deriving a rice parameter may be modified. That        is, only the left neighbor and the bottom neighbor of the        current scanning position may be considered similarly to the        local template for the context modeling of the sig_coeff_flag        syntax element.

(6) Context modeling of the coeff_sign_flag syntax element: due to thefact that the in stationarity within the sequence of signs and theprediction residual are frequently biased, the signs may be coded byusing the context models even when the global empirical distribution isalmost evenly distributed. A single dedicated context model may be usedfor coding of the sign, and the sign may be parsed after thesig_coeff_flag syntax element in order to keep all of the context codedbins together.

(7) Reduction in the context coded bins: a first scanning pass, that is,the transmission of the sig_coeff_flag syntax element, theabs_level_gt1_flag syntax element, and the par_level_flag syntax elementmay not be changed. However, the limit on the maximum number of ContextCoded Bins (CCBs) per sample may be eliminated, and may be processeddifferently. The reduction in the CCBs may be secured by designating themode as CCB>k as invalid. Here, k may be a positive integer. Forexample, k for the regular level coding mode may be 2, but is notlimited thereto. This limit may correspond to the reduction in aquantization space.

For example, the transform skip residual coding syntax may berepresented as in Table 20.

TABLE 20 Descriptor residual_ts_coding( x0, y0, log2TbWidth,log2TbHeight, cIdx )

log2SbSize = 1 Min( log2TbWidth, log2TbHeight ) < 2 ? 1 : 2 ) numSbCoeff 1 << ( log2SbSize << 1 ) lastSubBlock = ( 1 << ( log2TbWidth +log2TbHeight − 2 * log2SbSize ) ) − 1 /* Loop over subblocks ironslast to the top-left (DC) subblock */ inferDeSbCbf = 1 for( i −lastSubBlock; i >

 0

i ) }  xS = DiagScanOrder[ log2TbWidth − log2SbSize ][ log2TbHeight −log2SbSize ][ lastSubBlock ][ 0 ]  yS − DiagScanOrder[log2TbWidth log2SbSize ][ log2TbHeight − log2SbSize ][ lastSubBlock ][ 1]  if

 > 0  !infer

SbC

)   coded_sub_block_flag[xS ][ yS ] ae(v)  if( coded_sub_block_flag[xS][ yS ] && i > 0 )   inferD

SbCb

 0  } /* First scan pass */  inferSbDcSigCoef

Flag − 1  for

 n − ( i − − numSbCoeff − 1; n >

 0; n− − ) {   xC − ( xS << lop2SbSize )

 DiagScanOrder[ log2SbSize ][ log2SbSize ][ n ][ 0]   yC − ( yS <<lop2SbSize ) + DiagScanOrder[ log2SbSize ][ log2SbSize ][ n ][ 1]   if(coded_sub_block_flag[ xS ][ yS ] && 

 n > 0 | !inferSbD

SigCoeffFlag ) )

   sig_coeff_flad[ xC ][ yC ] ae(v)    if( sig_coeff_flag[xC ][ yC ] )    interSbDcSigCoeffFlag − 0   

  if( sig_coeff_Flag[ xC ][ yC ] ) {    coeff_sign_flag[ n ] ae(v)   abs_level_gtX_flag[ n ][ 0 ] ae(v)    if( abs

level

gtX

flag[ n ][ 0 ])     par_level_flag[ n ]   }   AbsLevelPassX[ xC ][ yC ]=     sig_coeff_flag[ xC ][ yC ] + par_level_flag[ n ] −abs_level_gtX_flag[ n ][ 0]  } /* Greater than X scan passes (numG

XFlags 5) */  for( i = 1; i <= numGtXFlags − 1 && abs_level_gtX_flag[ n][

 − 1 ] :

 ) {   for( n − numSbCoeff 1; n >

 0; n )

   xC = ( xS << log2SbSize ) + DiagScanOrder[ log2SbSize ][ log2SbSize][ n ][ 0 ]    yC

 ( yS << log2SbSize ) + DiagScanOrder[ log2SbSize ][ log2SbSize ][ n ][1 ]    abs_level_gtX_flag[ n ][ i ] ae(v)    AbsLevelPassX[ xC ][ yC ]

 2

 abs_level_gtX_flag[ n ][ i ]   }  } /* remainder scan pass */  for( n

 numSbCoeff

 n >

 0; n )

  xC

 ( xS << log2SbSize ) + DiagScanOrder[ log2SbSize ][ log2SbSize ][ n ][0]   yC = ( yS << log2SbSize ) + DiagScanOrder[ log2SbSize ][ log2SbSize][ n ][1 ]   if( abs_level_gtX_flag[ n ][ nuinGtXFlags

 1 ] )    abs_remainder[ n ] ae(v)   TransCoeffLevel[ x0 ][ y0 ][ cIdx][ xC ][ yC ]

 1 − 2 * coeff_sign_flag[ n ] )

  ( AbsLevelPassX[ xC ][ yC ] · abs_remainder[ n ] )  } } }

indicates data missing or illegible when filed

FIG. 10 is a diagram illustrating a residual signal decoder according toan example of the present document.

Meanwhile, as described with reference to Tables 3 to 5 or Tables 6 to8, before coding the residual signal, particularly, the residual signal,whether to apply the transform to the corresponding block may be firstdelivered. By expressing the correlation between the residual signals inthe transform domain, data compaction is performed and the compacteddata are the decoding apparatus, and if the correlation between theresidual signals is insufficient, the data compaction may not occursufficiently. In this case, the transform process including acomplicated calculation process may be omitted, and the residual signalof the pixel domain (spatial domain) may be delivered to the decodingapparatus.

Since the residual signal of the pixel domain which has not beentransformed has different characteristics (distribution of the residualsignal, the absolute level of each residual signal, and the like) fromthe residual signal of the general transform domain, the followingdescription proposes a method for coding the residual signal forefficiently delivering such a signal to the decoding apparatus accordingto an embodiment of the present document.

As illustrated in FIG. 10 , a transform application presence/absenceflag representing whether the transform is applied to the correspondingtransform block and a bitstream (or information about coded binarizationcode) may be input to a residual signal decoder 1000, and a (decoded)residual signal may be output.

The transform application presence/absence flag may be represented by atransform presence/absence flag, a transform skip presence/absence flag,or a syntax element transform_skip_flag. The coded binarization code mayalso be input to the residual signal decoder 1000 through thebinarization process.

The residual signal decoder 1000 may be included in the entropy decoderof the decoding apparatus. In addition, while the transform applicationpresence/absence flag has been distinguished from the bitstream forconvenience of explanation in FIG. 10 , the transform applicationpresence/absence flag may be included in the bitstream.

Alternatively, the bitstream may include information about the transformcoefficients (when the transform is applied, the syntax elementtransform_skip_flag=0) or information about (a value of) the residualsample (when the transform is not applied, the transform_skip_flag=1) aswell as the transform application presence/absence flag. The informationabout the transform coefficients may include, for example, information(or syntax elements) illustrated in Tables 3 to 5 or Tables 6 to 9.

The transform skip presence/absence flag may be transmitted in units oftransform block, and for example, in Tables 3 to 5, the transform skippresence/absence flag is limited to a specific block size (conditionwhich parses the transform_skip_flag is included only when the size ofthe transform block is 4×4 or less), but an embodiment may variouslyconfigure the size of the block which determines whether to parse thetransform skip presence/absence flag. The sizes of log 2TbWidth and log2TbHeight may be determined by variables wN and hN, and wN and hN mayhave, for example, one value of the following values illustrated inEquation 6.

wN={2,3,4,5,6}

hN={2,3,4,5,6}  Equation 6

For example, the syntax elements to which wN and hN having valuesaccording to Equation 6 may be applied may be represented as in Table21.

TABLE 21  if( transform_skip_enabled_flag && ( cIdx ! = 0 | |cu_mts_flag[ x0 ][ y0 ] = = 0 ) &&   ( log2TbWidth <= wN ) && (log2TbHeight <= hN ) )   transform_skip_flag[ x0 ][ y0 ][ cIdx ] ae(v)

For example, wN and hN may each have a value of 5, in which case thetransform skip presence/absence flag may be signaled for the blockhaving a width smaller than or equal to 32 and a height smaller than orequal to 32. Alternatively, wN and hN may each have a value of 6, inwhich case the transform skip presence/absence flag may be signaled forthe block having a width smaller than or equal to 64 and a heightsmaller than or equal to 64. For example, wN and hN may have values of2, 3, 4, 5, or 6 as is expressed in Equation 6, have the same values aseach other, and also have different values from each other. In addition,the width and height of the block in which the transform skippresence/absence flag may be signaled may be determined based on thevalues of wN and hN.

As described above, a method of decoding the residual signal may bedetermined according to the transform skip presence/absence flag. Byefficiently processing the signals having different statisticalcharacteristics from each other through the proposed method, it ispossible to reduce complexity in the entropy decoding process and toenhance coding efficiency.

FIG. 11 is a diagram illustrating a transform skip flag parsingdeterminator according to an embodiment of the present document.

Meanwhile, as described with reference to Tables 3 to 5 or Tables 6 to9, an embodiment may first deliver whether to apply the transform to thecorresponding block before coding the residual signal. By expressing thecorrelation between the residual signals in the transform domain, datacompaction is performed and the compacted data are delivered to thedecoder, and if the correlation between the residual signals isinsufficient, the data compaction may not occur sufficiently. In thiscase, the transform process including the complicated calculationprocess may be omitted and the residual signal of the pixel domain(spatial domain) may be delivered to the decoder. Since the residualsignal of the pixel domain which has not been transformed has differentcharacteristics (distribution degree of the residual signal, theabsolute level of each residual signal, and the like) from the residualsignal of the general transform domain, the following descriptionproposes a method for encoding the residual signal for efficientlydelivering such a signal to the decoder.

The transform skip presence/absence flag may be transmitted in units oftransform block, and for example, signaling of the transform skippresence/absence flag is limited to the size of a specific block(condition of parsing the transform_skip_flag is included only when thesize of the transform block is 4×4 or less), but an embodiment maydefine the condition of determining whether to parse the transform skippresence/absence flag as the number of pixels or samples within theblock rather than the information about the width or height of theblock. That is, the condition of determining whether to parse thetransform skip presence/absence flag may be defined as using the productof log 2TbWidth and log 2TbHeight among the conditions used to parse thetransform skip presence/absence flag (for example, syntax elementtransform_skip_flag). Alternatively, the transform skip presence/absenceflag may be parsed based on the product of the width (for example, log2TbWidth) and height (for example, log 2TbHeight) of the block.Alternatively, whether to parse the transform skip presence/absence flagmay be determined according to a value obtained by the product of thewidth (for example, log 2TbWidth) and height (for example, log2TbHeight) of the block. For example, the log 2TbWidth and the log2TbHeight may have one value of the following values illustrated inEquation 7.

log 2TbWidth={1,2,3,4,5,6}

log 2TbHeight={1,2,3,4,5,6}  Equation 7

According to an embodiment, when whether to parse the transform skippresence/absence flag is determined based on the number of sampleswithin the block, blocks of various shapes may be included in atransform exclusion block (in which the transform skip presence/absenceflag is not parsed) rather than determining whether to parse thetransform skip presence/absence flag based on the width and height ofthe block.

For example, when all of the log 2TbWidth and the log 2TbHeight aredefined as 2, only blocks of 2×4, 4×2, and 4×4 may be included in thetransform exclusion block, but when controlled by the number of samples,the block in which the number of samples is 16 or less within the blockis included in the transform exclusion block, such that the blocks of2×8 and 8×2 sizes as well as the blocks of 2×4, 4×2, and 4×4 may also beincluded in the transform exclusion block.

A method of decoding the residual signal may be determined according tothe transform skip presence/absence flag, and by efficiently processingthe signals having different statistical characteristics according tothe aforementioned embodiment, it is possible to reduce complexity inthe entropy decoding process and to enhance coding efficiency.

For example, as illustrated in FIG. 11 , information about whether toenable the transform skip within the high level syntax, block sizeinformation, and information about whether to apply the MultipleTransform Selection (MTS) may be input to the transform skip flagparsing determinator 1100, and the transform skip flag may be output.Alternatively, the information about whether to enable the transformskip within the high level syntax and the block size information may beinput to the transform skip flag parsing determinator, and the transformskip flag may also be output based on the information. That is, thetransform skip flag may be output (or parsed) based on the block sizeinformation, when the transform skip is enabled according to theinformation about whether to enable the transform skip within the highlevel syntax. The aforementioned information may be included in thebitstream or the syntax. The transform skip flag parsing determinator1100 may be included in the entropy decoder of the decoding apparatus.For example, a method in which the transform skip flag is determinedbased on the aforementioned information may be as follows.

FIG. 12 is a flowchart for explaining a method for coding the transformskip presence/absence flag according to an embodiment of the presentdocument.

The aforementioned embodiment will be described again with reference toFIG. 12 as follows.

First, whether the transform skip within the high level syntax isenabled may be determined (S1200). For example, whether the transformskip within the high level syntax is enabled may be determined based onthe information about whether to enable the transform skip within thehigh level syntax (for example, transform_skip_enabled_flag syntaxelement). For example, the information about whether to enable thetransform skip (for example, transform_skip_enabled_flag syntax element)may be signaled based on a sequence parameter set (SPS). Alternatively,the information about whether to enable the transform skip may besignaled by being included in the SPS syntax. Alternatively, theinformation about whether to enable the transform skip may also besignaled based on a picture parameter set (PPS) or signaled by beingincluded in the PPS syntax, but the present document is not limitedthereto. Here, the fact that the transform skip within the high levelsyntax is enabled may represent that the transform skip is enabled forthe slice/block referring to the corresponding high level syntax.Whether the transform skip is substantially applied to the block inwhich the transform skip is enabled may be determined based on theaforementioned transform skip flag.

For example, when the transform skip within the high level syntax isenabled, whether the value of the cu_mts_flag syntax element within thesyntax is 0 may be determined (S1210). For example, whether the value ofthe cu_mts_flag syntax element is 0 may be determined based on theinformation about whether to enable the Multiple Transform Selection(MTS). Alternatively, the information about whether to enable the MTSmay be determined based on the sps_mts_enabled_flag syntax element.

For example, when the value of the cu_mts_flag syntax element is 0,whether the product of log 2TbWidth and log 2TbHeight is smaller than orequal to a threshold may be determined (S1220). Alternatively, whether avalue obtained by the product of a log value having a base 2 of thewidth of the current block and a log value having a base 2 of the heightof the current block is smaller than the threshold may be determined.Alternatively, whether a value obtained by the product of the width andheight of the current block is smaller than the threshold may bedetermined. For example, whether the product of log 2TbWidth and log2TbHeight is smaller than or equal to the threshold may be determinedbased on the block size information. The block size information mayinclude the information about the width and height of the current block.Alternatively, the block size information may include information aboutlog values having a base 2 of the width and height of the current block.

For example, when the product of log 2TbWidth and log 2TbHeight issmaller than or equal to the threshold, the value of the transform skippresence/absence flag (or transform_skip_flag syntax element) may bedetermined as 1 (S1230). Alternatively, the transform skippresence/absence flag having the value of 1 may be parsed.Alternatively, for example, when the product of log 2TbWidth and log2TbHeight is smaller than or equal to the threshold according to thesetting or the condition, the value of the transform skippresence/absence flag (or transform_skip_flag syntax element) may bedetermined as 0. Alternatively, the transform skip presence/absence flaghaving the value of 0 may be parsed. Alternatively, the transform skippresence/absence flag may not be parsed. That is, the determined valueof the transform skip presence/absence flag may be changed according tothe setting or the condition as an example. That is, the transform skippresence/absence flag may represent the information that the transformskip is applied to the current block when the product of log 2TbWidthand log 2TbHeight is smaller than or equal to the threshold.Alternatively, the current block may be included in the transformexclusion block based on the transform skip presence/absence flag, andthe transform is not applied to the current block.

For example, the value of the transform skip presence/absence flag (ortransform_skip_flag syntax element) may be determined as 0, when thetransform skip within the high level syntax is not enabled, when thevalue of the cu_mts_flag syntax element is not 0, or when the product oflog 2TbWidth and log 2TbHeight is greater than the threshold (S1240).Alternatively, the transform skip presence/absence flag having the valueof 0 may be parsed. Alternatively, the transform skip presence/absenceflag may not be parsed. Alternatively, for example, the value of thetransform skip presence/absence flag (or transform_skip_flag syntaxelement) may be determined as 1, when the transform skip within the highlevel syntax is not enabled, when the value of the cu_mts_flag syntaxelement is not 0, and when the product of log 2TbWidth and log 2TbHeightis greater than the threshold according to the setting or the condition.Alternatively, the transform skip presence/absence flag having a valueof 1 may be parsed. That is, the determined value of the transform skippresence/absence flag is an example, and may be changed according to thesetting or the condition. That is, when the transform skip within thehigh level syntax is not enabled, when a value of the cu_mts_flag syntaxelement is not 0, and when the product of log 2TbWidth and log 2TbHeightis greater than the threshold, the transform skip presence/absence flagmay represent information that the transform skip is not applied to thecurrent block. Alternatively, the current block may not be included inthe transform exclusion block based on the transform skippresence/absence flag, and may be transformed.

Alternatively, for example, the cu_mts_flag syntax element may also berepresented by an MTS tu_mts_flag syntax element or an mts_flag_syntaxelement, and the sps_mts_intra_enabled_flag syntax element (orsps_explicit_mts_intra_enabled_flag syntax element) or thesps_mts_inter_enabled_flag syntax element (orsps_explicit_mts_inter_enabled_flag syntax element) may be signaled (bybeing included in the SPS syntax) based on the sps_mts_enabled_flagsyntax element.

Meanwhile, another embodiment of the present document proposes a methodfor defining the transform skip size when using a transform kernel indexincluding the transform presence/absence information.

Since the block which has not been transformed (or transform coded) hasdifferent characteristics of the residual data from the block which hasbeen transformed generally, an efficient residual data coding method forthe block which has not been transformed may be required. The transformpresence/absence flag representing whether to perform the transform maybe transmitted in units of transform block or transform unit, and thepresent document does not limit the size of the transform block. Forexample, when the transform presence/absence flag is 1, the residual(data) coding (for example, Table 20 and residual coding for thetransform skip) proposed in the present document may be performed, andwhen the transform presence/absence flag is 0, the residual coding as inTables 3 to 5 or Tables 6 to 9 may be performed. For example, thetransform presence/absence flag may include the transform_skip_flagsyntax element included in the residual coding syntax or the transformunit syntax. In addition, when the value of the transform_skip_flagsyntax element is 1, the residual coding method (for the transform skip)proposed in an embodiment of the present document may be performed.

Alternatively, for example, when the value of the transform_skip_flagsyntax element is 1, the residual coding in which the transform is notperformed may also be performed based on the transform skip residualcoding (residual_ts_coding) syntax according to an if(!transform_skip_flag) condition. Alternatively, when the value of thetransform_skip_flag syntax element is 0, the residual coding in whichthe transform is performed based on the residual coding(residual_coding) syntax may be performed according to the if(!transform_skip_flag) condition.

Alternatively, for example, the residual coding which excludes thecoeff_sign_flag syntax element below the coded_sub_block_flag syntaxelement may follow some or all of the residual coding method (for thetransform skip) proposed in an embodiment of the present document.

Alternatively, for example, the unified transform type signaling methodproposed in an embodiment of the present document may be performed, andat this time, when the value of the tu_mts_idx syntax element is 1 (orwhen the tu_mts_idx syntax element represents information that thetransform is not applied to the target block, the residual coding method(for the transform skip) proposed in an embodiment of the presentdocument may be performed. Alternatively, when the value of thetu_mts_idx syntax element is 0 (or when the value of the tu_mts_idxsyntax element is a value other than 1), the residual coding as inTables 3 to 5 or Tables 6 to 9 or the residual coding in which thetransform is performed based on the residual coding (residual_coding)syntax may be performed. In this case, as described with the unifiedtransform type signaling method proposed in an embodiment of the presentdocument, the transform presence/absence flag (or transform_skip_flagsyntax element) and/or the transform index (or mts_idx syntax element)may be omitted in Tables 3 to 5.

Alternatively, for example, assuming that the tu_mts_idx syntax elementhaving the value of 0 represents that the transform is not applied (ortransform skip) to the target block, the residual coding method (for thetransform skip) proposed in an embodiment of the present document may beperformed, when the value of the tu_mts_idx syntax element is 0.Alternatively, when the value of the tu_mts_idx syntax element is not 0,the residual coding in which the transform is performed based on theresidual coding (residual_coding) syntax may be performed as in Tables 3to 5 or Tables 6 to 9. In this case, the transform presence/absence flag(or transform_skip_flag syntax element) and/or the transform index (ormts_idx syntax element) may be omitted. In this case, the“tu_mts_idx==1?” determination procedure or condition may be replacedwith the “tu_mts_idx==0?” determination procedure or condition.

As described with the unified transform type signaling method proposedin an embodiment of the present document, the binarization for thetransform presence/absence flag (or transform_skip_flag syntax element)or the transform index (or mts_idx syntax element) may be each defineddifferently, for example, in the case of the MTS & TS enabled, the MTSenabled, and the TS enabled as in Table 17 or Table 18. Alternatively,the size at which the transform skip is defined (or the size capable ofthe transform skip) may also be defined differently according to whetherthe value of the mts_enabled is 0 or 1. Alternatively, the size capableof the transform skip may also be defined based on the MTS enabled (orinformation about whether the MTS is enabled). For example, the MTSenabled may represent the information about whether the MTS is enabled,and may be derived based on the sps_mts_enabled_flag syntax element. Forexample, the fact that the value of the MTS enabled is 1 may representthat the value of the sps_mts_enabled_flag syntax element is 1.Alternatively, the fact that the value of the MTS enabled is 1 may alsorepresent information that the MTS is enabled. Alternatively, the factthat the value of the MTS enabled is 0 may represent that the value ofthe sps_mts_enabled_flag syntax element is 0. Alternatively, the factthat the value of the MTS enabled is 0 may also represent informationthat the MTS is not enabled.

For example, when the value of the MTS enabled is 1, the size of thetransform skip (or the block size capable of the transform skip) may bedependent on the enabled MTS. For example, if the size of the MTS isenabled at 32 or less (or if the MTS is enabled only when the block sizeis 32 or less), the transform skip may be always defined for the blockhaving the size of 32 or less in the same manner as above.

Alternatively, for example, when the value of the MTS enabled is 1, theencoding apparatus and the decoding apparatus may use a predetermined orpreset maximum size. In addition, the TS enabled may be definedaccording to the maximum size. For example, the encoding apparatus andthe decoding apparatus may be defined to use the transform skip for theblock having a length of one side which is smaller than or equal to 8.In this case, the value of the TS enabled is defined as 0 with respectto the block having a length of one side of the block which is greaterthan 8, thereby effectively applying the binarization table illustratedin Table 17 or Table 18. Alternatively, the maximum size information ofthe transform skip block (or capable of the transform skip) may also berepresented by using the maximum number of samples rather than themaximum length of one side of the block.

Alternatively, for example, when the value of the MTS enabled is 1, themaximum size of the transform skip (or block capable of the transformskip) may be defined separately from the size of the MTS (or the blocksize in which the MTS is enabled). In this case, the information aboutthe size of the transform skip (or block capable of the transform skip)may be signaled to define the size of the MTS (or the block size inwhich the MTS is enabled). Alternatively, the information may betransmitted from the encoding apparatus to the decoding apparatus. Forexample, if the size of the MTS is enabled at 32 or less (or if the MTSis enabled only when the block size is 32 or less), a flag about whetherto follow the size of the MTS (or the block size at which the MTS isenabled) may be signaled, and in the case of not following the maximumsize of the MTS (or the maximum size of the block at which the MTS isenabled), the information for enabling the maximum size of the transformskip (or block capable of the transform skip) up to 16 may be signaled.In this case, when the length of one side of the block is 16 or more,the value of the TS enabled is defined as 0, thereby effectivelyapplying the binarization table illustrated in Table 17 or Table 18.Alternatively, the maximum size information of the transform skip block(or capable of the transform skip) may also be represented by using themaximum number of samples rather than the maximum size of one side ofthe block.

Alternatively, for example, when the value of the MTS enabled is 0, theencoding apparatus and the decoding apparatus may use a predetermined orpreset maximum size. For example, when the value of the MTS enabled is 0and the value of the TS enabled is 1, the encoding apparatus and thedecoding apparatus may be defined to use the transform skip for theblock having a length of one side which is smaller than or equal to 8.Alternatively, the maximum size information of the transform skip block(or capable of the transform skip) may also be represented by using themaximum number of samples rather than the maximum size of one side ofthe block.

Alternatively, for example, when the value of the MTS enabled is 0, themaximum size information of the transform skip (or block capable of thetransform skip) may be transmitted. For example, the information whichenables the maximum size of the transform skip (or block capable of thetransform skip) up to 16 may be signaled by the high level syntax. Inthis case, when the length of one side of the block is 16 or more, thevalue of the TS enabled is defined as 0, thereby effectively applyingthe binarization table illustrated in Table 17 or Table 18.Alternatively, the maximum size information of the transform skip block(or capable of the transform skip) may be represented by using themaximum number of samples rather than the maximum size of one side ofthe block.

For example, the tu_mts_idx syntax element may be encoded/decoded basedon the aforementioned CABAC. In this case, the bin string of thetu_mts_idx syntax element may include, for example, bins as illustratedin Table 17 or Table 18. At least one of the bins of the bin string ofthe tu_mts_idx syntax element may be coded (or regular-coded) based onthe context information (or context model).

A context index representing the context model for each of theregular-coded bins may be derived based on a context index increment anda context index offset. Alternatively, for example, the context indexmay be represented by ctxIdx, the context index increment may berepresented by ctxInc, and the context index offset may be representedby ctxIdxOffset. In addition, the ctxIdx may be derived by the sum ofthe ctxInc and the ctxIdxOffset. For example, the ctxInc may be deriveddifferently for each bin as illustrated in Table 19. The ctxIdxOffsetmay represent the lowest value of the ctxIdx. Alternatively, forexample, the context index may be determined based on coded quad-treedepth (cqtDepth) as illustrated in Table 19. Alternatively, for example,the context index may be determined according to the block size, theratio of the width-to-the height of the block, whether to perform theintra or inter prediction of the block, whether to apply the transformskip to the neighbor, or the like.

For example, when the block size is smaller than 8×8, the context modelof an index 0 may be used, and when the block size is greater than orequal to 8×8, the context model of an index 1 may be used.

Alternatively, for example, when the ratio of the width-to-height of theblock is 1, the context model of the index 0 may be used, when the widthof the block is greater than the height of the block, the context modelof the index 1 may be used, and when the height of the block is greaterthan the width of the block, the context model of an index 2 may beused. In this case, for example, the context index which is determinedbased on the width and height of the block may be as illustrated inTable 22 below.

TABLE 22 Syntax binIdx element 0 1 2 3 4 >=5 tu_mts_idx (cbWidth == 3 .. . 8 9 10 11 na (MTS & cbHeight) ? 0: (1 + TS) ((cbWidth > cqtDepth)cbHEight) ? 1:2) tu_mts_idx 1 . . . 6 7 8 9 na na (MTS) (1 + cqtDepth)tu_mts_idx (cbWidth == na na na na na (TS) cbHeight) ? 0: ((cbWidth >cbHEight) ? 1:2)

Alternatively, for example, when the prediction mode of the currentblock is the intra mode, the context model of the index 0 may be used,and when the prediction mode of the current block is the inter mode, thecontext model of the index 1 may be used.

For example, the tu_mts_idx syntax element may be coded by using thecontext model according to the index determined as described above.Since the context model and the number of models may be variouslydefined based on probability and distribution, the present document isnot limited to the specific context model and the number of contextmodels.

For example, the index may represent the context index, the index 0 mayrepresent that the ctxIdx value is 0, and the index 1 may represent thatthe ctxIdx value is 1.

For example, the lowest value of the ctxIdx may be represented by aninitial value (initValue) of the ctxIdx, and the initial value of thectxIdx may be determined based on the context table. Alternatively, theinitial value of the ctxIdx may be determined by using the context tableand an initial type (initType). The initial type may be determined inadvance. Alternatively, the initial type may also be determined bysignaling the related information. For example, the initial type may besignaled by the initial type information (for example, cabac_init_flagsyntax element or cabac_init_idx syntax element).

That is, the bins of the bin string of the tu_mts_idx syntax element maybe context based coded (or regular-coded) based on the context model forthe respective bins. In this case, the context model may be derived bythe sum of the ctxInc and the ctxIdxOffset. In addition, the ctxInc maybe determined differently for each bin.

For example, the encoding apparatus may encode the bins by deriving thevalue of the tu_mts_idx syntax element, deriving the binarization binscorresponding to the value through the binarization procedure, andderiving the context model for each of the bins. In this case, a bitstring having a length which is equal to or shorter than the lengths ofthe bins may be output according to the arithmetic coding based on thecontext model.

For example, the decoding apparatus may decode the bins for thetu_mts_idx syntax element by deriving candidate bin strings through thebinarization procedure for the tu_mts_idx syntax element, andsequentially parsing bits for the tu_mts_idx syntax element from thebitstream. In this case, the decoding apparatus may decode the bins byderiving the context model for each of the bins. It may be determinedwhether the decoded bins correspond to one of the candidate bin strings.When the decoded bins correspond to one of the candidate bin strings,the decoding apparatus may derive a value represented by thecorresponding bin string as the value of the tu_mts_idx syntax element.When the decoded bins do not correspond to one of the candidate binstrings, the decoding apparatus may additionally parse the bit andrepeat the aforementioned procedure.

As described above, an embodiment of the present document maydifferently determine the ctxInc and/or the ctxIdx based on at least oneof the block size, the ratio of the width-to-height of the block,whether to perform the intra or inter prediction of the block, whetherto apply the transform skip to the neighbor, or the like in coding thetu_mts_idx syntax element, and in this case, a different context modelmay be adaptively applied to the bin of the same bin index (binIdx)without signaling additional information.

For example, first context information may be derived for the i-th binfor a first block within the current picture, and second contextinformation may be derived for the same i-th bin for a second blockwithin the current picture. Here, i may correspond to a bin index, andmay represent, for example, one value of 0 to 4 as illustrated in Table19 or Table 22. For example, the context information may include theinformation about the context index or the context model.

Meanwhile, for example, at least some of the information according tothe aforementioned embodiments of the present document may be includedin the high level syntax as illustrated in Tables 23 to 27.Alternatively, at least some of the information according to theaforementioned embodiments of the present document may be signaled bybeing included in the high level syntax. Alternatively, at least some ofthe information according to the aforementioned embodiments may beincluded in a sequence parameter set (SPS) syntax. Alternatively, atleast some of the information according to the aforementionedembodiments may be signaled by being included in the SPS syntax. Forexample, Tables 23 to 27 may consecutively represent one syntax, and thesyntax elements included in the syntax may be sequentially signaled,configured, or parsed.

TABLE 23 Descriptor seq_parameter_set_rbsp( ) { sps_decoding_parameter_set_id u(4)  sps_video_parameter_set_id u(4) sps_max_sublayers_minus1 u(3)  sps_reserved_zero_4bits u(4) sps_ptl_dpb_hrd_params_present_flag u(1)  if(sps_ptl_dpb_hrd_params_present_flag   profile_tier_level( 1,sps_max_sublayers_minus1 )  gdr_enabled_flag u(1) sps_seq_parameter_set_id u(4)  chroma_format_idc u(2)  if(chroma_format_idc = = 3 )   separate_colour_plane_flag u(1) ref_pic_resampling_enabled_flag u(1)  pic_width_max_in_luma_samplesue(v)  pic_height_max_in_luma_samples ue(v)  sps_log2_ctu_size_minus5u(2)  subpics_present_flag u(1)  if( subpics_present_flag ) {  sps_num_subpics_minus1 u(8)   for( i = 0; i <= sps_num_subpics_minus1;i−+ ) {    subpic_ctu_top_left_x[ i ] u(v)    subpic_ctu_top_left_y[ i ]u(v)    subpic_width_minus1[ i ] u(v)    subpic_height_minus1[ i ] u(v)   subpic_treated_as_pic_flag[ i ] u(1)   loop_filter_across_subpic_enabled_flag[ i ] u(1)   }  } sps_subpic_id_present_flag u(1)  if( sps_subpics_id_present_flag ) {  sps_subpic_id_signalling_present_flag u(1)   if(sps_subpics_id_signalling_present_flag ) {

TABLE 24   sps_subpic_id_len_minus1 ue(v)   for( i = 0; i <=sps_num_subpics_minus1

 )    sps_subpic_id[ i ] u(v)  } } bit_depth_minus8 ue(v)min_qp_prime_ts_minus4 ue(v) sps_weighted_pred_flag u(1)sps_weighted_bipred_flag u(1) log2_max_pic_order_cnt_lsb_minus4 u(4)sps_poc_msb_flag u(1) if( sps_poc_msb_flag )  poc_msb_len_minus1 ue(v)if( sps_max_sublayers_minus1 > 0 )  sps_sublayer_dpb_params_flag u(1)if( sps_ptl_dpb_hrd_params_present_flag )  dpb_parameters( 0,sps_max_sublayers_minus1,  sps_sublayer_dpb_params_flag )long_term_ref_pics_flag u(1) inter_layer_ref_pics_present_flag u(1)sps_idr_rpl_present_flag u(1) rpl1_same_as_rpl0_flag u(1) for( i = 0; i< !rpl1_same_as_rpl0_flag ? 2 : 1; i++ ) {  num_ref_pic_lists_in_sps[ i] ue(v)  for( j = 0, j < num_ref_pic_lists_in_sps[ i ]; j++)  ref_pic_list_struct( i, j ) } if( ChromaArrayType != 0 ) qtbtt_dual_tree_intra_flag u(1) log2_min_luma_coding_block_size_minus2ue(v) partition_constraints_override_enabled_flag u(1)sps_log2_diff_min_qt_min_cb_intra_slice_luma ue(v)sps_log2_diff_min_qt_min_cb_inter_slice ue(v)sps_max_mtt_hierarchy_depth_inter_slice ue(v)sps_max_mtt_hierarchy_depth_intra_slice_luma ue(v) if(sps_max_mtt_hierarchy_depth_intra_slice_luma != 0 ) { sps_log2_diff_max_bt_min_qt_intra_slice_luma ue(v) sps_log2_diff_max_tt_min_qt_intra_slice_luma ue(v) } if(sps_max_mtt_hierarchy_depth_inter_slice != 0 ) { sps_log2_diff_max_bt_min_qt_inter_slice ue(v) sps_log2_diff_max_tt_min_qt_inter_slice ue(v) } if(qtbtt_dual_tree_intra_flag ) { sps_log2_diff_min_qt_min_cb_intra_slice_chroma ue(v) sps_max_mtt_hierarchy_depth_intra_slice_chroma ue(v)  if(sps_max_mtt_hierarchy_depth_intra_slice_chroma != 0 ) {  sps_log2_diff_max_bt_min_qt_intra_slice_chroma ue(v)  sps_log2_diff_max_tt_min_qt_intra_slice_chroma ue(v)

indicates data missing or illegible when filed

TABLE 25  } } sps_max_luma_transform_size_64_flag u(1)sps_joint_cbcr_enabled_flag u(1) if( ChromaArrayType != 0 ) { same_qp_table_for_chroma u(1)  numQpTables = same qp table for chroma ?1 : ( spa joint cbcr enabled flag ? 3 : 2 )  for( i = 0; i <numQpTables; i++) {   qp_table_start_minus26[ i ] se(v)  num_points_in_qp_table_minus1[ i ] ue(v)   for( j = 0; j <=num_points_in_qp_table_minus1[ i ]; j++ ) {    delta_qp_in_val_minus1[ i][ j ] ue(v)    delta_qp_diff_val[ i ][ j ] ue(v)   }  } }sps_sao_enabled_flag u(1) sps_alf_enabled_flag u(1)sps_transform_skip_enabled_flag u(1) if( sps_transform_skip_enabled_flag)  sps_bdpcm_enabled_flag u(1) if( sps_bdpcm_enabled_flag &&chroma_format_idc = = 3 )  sps_bdpcm_chroma_enabled_flag u(1)sps_ref_wraparound_enabled_flag u(1) if( sps_ref_wraparound_enabled_flag)  sps_ref_wraparound_offset_minus1 ue(v) sps_temporal_mvp_enabled_flagu(1) if( sps_temporal_mvp_enabled_flag )  sps_sbtmvp_enabled_flag u(1)sps_amvr_enabled_flag u(1) sps_bdof_enabled_flag u(1) if(sps_bdof_enabled_flag )  sps_bdof_pic_present_flag u(1)sps_smvd_enabled_flag u(1) sps_dmvr_enabled_flag u(1) if(sps_dmvr_enabled_flag)  sps_dmvr_pic_present_flag u(1)sps_mmvd_enabled_flag u(1) sps_isp_enabled_flag u(1)sps_mrl_enabled_flag u(1) sps_mip_enabled_flag u(1) if( ChromaArrayType!= 0 )  sps_cclm_enabled_flag u(1) if( chroma_format_idc = = 1 ) { sps_chroma_horizontal_collocated_flag u(1) sps_chroma_vertical_collocated_flag u(1) } sps_mts_enabled_flag u(1)

TABLE 26 if( sps_mts_enabled_flag ) { sps_explicit_mts_intra_enabled_flag u(1) sps_explicit_mts_inter_enabled_flag u(1) } sps_sbt_enabled_flag u(1)sps_affine_enabled_flag u(1) if( sps_affine_enabled_flag) { sps_affine_type_flag u(1)  sps_affine_amvr_enabled_flag u(1) sps_affine_prof_enabled_flag u(1)  if( sps_affine_prof_enabled_flag )  sps_prof_pic_present_flag u(1) } if( chroma_format_idc = = 3 ) { sps_palette_enabled_flag u(1)  sps_act_enabled_flag u(1) }sps_bcm_enabled_flag u(1) sps_ibc_enabled_flag u(1)sps_ciip_enabled_flag u(1) if( sps_mmvd_enabled_flag ) sps_fpel_mmvd_enabled_flag u(1) sps_triangle_enabled_flag u(1)sps_lmcs_enabled_flag u(1) sps_lfnst_enabled_flag u(1)sps_ladf_enabled_flag u(1) if( sps_ladf_enabled_flag ) { sps_num_latf_intervals_minus2 u(2)  sps_ladf_lowest_interval_qp_offsetse(v)  for( i = 0; i < sps_num_ladf_intervals_minus2 + 1; i++ ) {  sps_ladf_qp_offset[ i ] se(v)   sps_ladf_delta_threshold_minus1[ i ]ue(v)  } } sps_sealing_list_enabled_flag u(1)sps_loop_filter_across_virtual_boundaries_disabled_present_flag u(1) if(sps_loop_filter_across_virtual_boundaries_disabled_pre- sent_flag ) { sps_num_ver_virtual_boundaries u(2)  for( i = 0; i <sps_num_ver_virtual_boundaries; i++ )   sps_virtual_boundaries_pos_x[ i] u(13)  sps_num_hor_virtual_boundaries u(2)  for( i = 0; i <sps_num_hor_virtual_boundaries; i−+ )   sps_virtual_boundaries_pos_y[ i] u(13) } if( sps_ptl_dpb_hrd_params_present_flag ) { sps_general_hrd_params_present_flag u(1)  if(sps_general_hrd_params_present_flag ) {   general_hrd_parameters( )

TABLE 27    if( sps_max_sublayers_minus1 > 0 )    sps_sublayer_cpb_params_present_flag u(1)    firstSubLayer =sps_sublayer_cpb_pararns_present_flag      sps_max_sublayers_minus1   ols_hrd_parameters( firstSubLayer, sps_max_sub-    layers_minus1 )  }  }  field_seq_flag u(1)  vui_parameters_present_flag u(1)  if(vui_parameters_present_flag )   vui_parameters( ) /* Specified in ITC-TH.SEI | ISO/IEC   23002-7 */  sps_extension_flag u(1)  if(sps_extension_flag )   while( more_rbsp_data( ) )   sps_extension_data_flag u(1)  rbsp_trailing_bits( ) }

For example, as illustrated in Tables 23 to 27, the informationrepresented by the syntax elements included in the SPS syntax orsemantics of the syntax elements may be represented as in Tables 28 to35.

TABLE 28 Sequence parameter set RBSP semantics sps_seq_parameter_set_idprovides an identifier for the SPS for reference by other syntaxelements. The value of sps_serq_parameter_set_id shall be in the rangeof 0 to 15, inclusive. intra_only_constraint_flag equal to 1 specifiesthat it is a requirement of bitstream conformance that tile_group_typeshall be equal to 1. intra_only_constraint_flag equal to 0 does notimpose a constraint. max_bitdepth_constraint_idc specifies that it is arequirement of bitstream conformance that bit_depth_luma_minus8 andbit_depth_chroma_minus8 shall be in the range of 0 tomax_bitdepth_constraint_idc, inclusive. max_chroma_format_constraint_idcspecifies that it is a requirement of bitstream conformance thatchroma_format_idc shall be in the range of 0 to maxchroma_format_constraint_idc, inclusive. frame_only_constraint_flagequal to 1 specifies that it is a requirement of bitstream conformancethat the CVS conveys pictures that represent fames.frame_only_constraint_flag equal to 0 does not impose a constraint.no_qtbtt_dual_tree_intra constraint_flag equal to 1 specifies that it isa requirement of bitstream conformance that qtbtt_dual_tree_intra_flagshall be equal to 0. no_qtbtt_dual_tree_intra constraint_flag equal to 0does not impose a constraint. no_sao_constraint_flag equal to 1specifies that it is a requirement of bitstream conformance thatsps_sao_enabled_flag shall be equal to 0. no_sao_constraint_flag equalto 0 does not impose a constraint. no_alf_constraint_flag equal to 1specifies that it is a requirement of bitstream conformance thatsps_alf_enabled_flag shall be equal to 0. no_alf_constrain_flag equal to0 does not impose a constraint. no_pcm_constraint_flag equal to 1specifies that it is a requirement of bitstream conformance thatpcm_enabled_flag shall be equal to 0. no_pcm_constraint_flag equal to 0does not impose a constraint. no_temporal_mvp_constraint_flag equal to 1specifies that it is a requirement of bitstream conformance thatsps_temporal_mvp_enabled_flag shall be equal to 0.no_temporal_mvp_constraint_flag equal to 0 does not impose a constraint.no_sbtmvp_constraint_flag equal to 1 specifies that it is a requirementof bitstream conformance that sps_sbtmvp_enabled_flag shall be equal to0. no_sbtmvp_constraint flag equal to 0 does not impose a constraint.no_amvr_constraint_flag equal to 1 specifies that it is a requirement ofbitstream conformance that sps_amvr_enabled_flag shall be equal to 0.no_amvr_constraint_flag equal to 0 does not impose a constraint.no_cclm_constraint_flag equal to 1 specifies that it is a requirement ofbitstream conformance that sps_cclm_enabled_flag shall be equal to 0.no_cclm_constraint_flag equal to 0 does not impose a constraint.no_affine_motion_constraint_flag equal to 1 specifies that it is arequirement of bitstream conformance that sps_affine_enabled_flag shallbe equal to 0. no_affine_motion_constraint_flag equal to 0 does notimpose a constraint. no_ladf_constraint_flag equal to 1 specifies thatit is a requirement of bitstream conformance that sps_ladf_enabled_flagshall be equal to 0. no_ladf_constraint_flag equal to 0 does not imposea constraint. no_dep_quant_constraint_flag equal to 1 specifies that itis a requirement of bitstream conformance that dep_quant_enabled_flagshall be equal to 0. no_dep_quant_constraint_flag equal to 0 does notimpose a constraint. no_sign_data_hiding_constraint_flag equal to 1specifies that it is a requirement of bitstream conformance thatsign_data_hiding_enabled_flag shall be equal to 0.no_sign_data_hiding_constraint_flag equal to 0 does not impose aconstraint. chroma_format_idc specifies the chroma sampling relative tothe luma sampling as specified in clause 6.2. The value ofchroma_format_idc shall be in the range of 0 to 3, inclusive.

TABLE 29 Sequence parameter set RBSP semanticsseparate_colour_plane_flag equal to 1 specifies that the three colourcomponents of the 4:4:4 chroma format are coded separately.separate_colour_plane_flag equal to 0 specifies that the colourcomponents are not coded separately. When separate_colour_plane_flag isnot present, it is inferred to be equal to 0. Whenseparate_colour_plane_flag is equal to 1, the coded picture consists ofthree separate components, each of which consists of coded samples ofone colour plane (Y, Cb, or Cr) and uses the monochrome coding syntax.In this case, each colour plane is associated with a specificcolour_plane_id value.  NOTE 1 - There is no dependency in decodingprocesses between the colour planes having different colour_plane_id values. For example, the decoding process of a monochrome picture withone value of colour_plane_id does not use  any data from monochromepictures having different values of colour_plane_id for interprediction. Depending on the value of separate colour plane flag, thevalue of the variable ChromaArrayType is assigned as follows: - Ifseparate colour plane flag is equal to 0. ChromaArrayType is set equalto chroma format idc. - Otherwise (separate_colour_plane_flag is equalto 1). ChromaArrayType is set equal to 0. pic_width_in_luma_samplesspecifies the width of each decoded picture in units of luma samples.pic_width_in_luma_samples shall not be equal to 0 and shall be aninteger multiple of MinCbSizeY. pic_height_in_luma_samples specifies theheight of each decoded picture in units of luma samples.pic_height_in_luma_samples shall not be equal to 0 and shall be aninteger multiple of MinCbSizeY. bit_depth_luma_minus8 specifies the bitdepth of the samples of the luma array BitDepth_(Y) and the value of theluma quantization parameter range offset QpBdOffset_(Y) as follows: BitDepth_(Y) = 8 + bit_depth_luma_minus8  QpBdOffset_(Y) = 6 *bit_depth_luma_minus8 bit_depth_luma_minus8 shall be in the range of 0to 8, inclusive. bit_depth_chroma_minus8 specifies the bit depth of thesamples of the chroma arrays BitDepth_(C) and the value of the chromaquantization parameter range offset QpBdOffset_(C) as follows: BitDepth_(C) = 8 + bit_depth_chroma_minus8  QpBdOffset_(C) = 6 *bit_depth_chroma_minus8 bit_depth_chroma_minus8 shall be in the range of0 to 8, inclusive. log2_max_pic_order_cnt_lsb_minus4 specifies the valueof the variable MaxPicOrderCntLsb that is used in the decoding processfor picture order count as follows:  MaxPicOrderCntLsb =2^(( log2 max pic order cnt lsb minus 4 − 4 )) The value oflog2_max_pic_order_cnt_lsb_minus4 shall be in the range of 0 to 12,inclusive. qtbtt_dual_tree_intra_flag equal to 1 specifies that for 1tile groups or for P tile groups where the current picture is the onlyreference picture for the the group, each CTU is split into coding unitswith 64×64 luma samples using an implicit quadtree split and that thesecoding units are the root of two separate coding quadtree syntaxstructure for luma and chroma. log2_ctu_size_minus2 plus 2 specifies theluma coding tree block size of each CTU.

TABLE 30 Sequence parameter set RBSP semanticslog2_min_luma_coding_block_size_minus2 plus 2 specifies the minimum lumacoding block size. The variables CtbLog2SizeY, CtbSizeY, MinCbLog2SizeY,MinCbSizeY, MinTbLog2SizeY, MaxTbLog2SizeY, MinTbSizeY, MaxTbSizeY,PicWidthInCtbsY, PicHeighInCtbsY, PicSizeInCtbsY, PicWidthInMinCbsY,PicHeightInMinCbsY, PicSizeInMinCbsY, PicSizeInSamplesY,PicWidthInSamplesC and PicHeightInSamplesC are derived as follows: CtbLog2SizeY = log2_ctu_size_minus2 + 2  CtbSizeY = 1 << CtbLog2SizeY MinCbLog2SizeY = log2_min_luma_codingS_block_size_minus2 − 2 MinCbSizeY = 1 << MinCbLog2SizeY  MinTbLog2SizeY = 2  MaxTbLog2SizeY =6  MinTbSizeY = 1 << MinTbLog2SizeY  MaxTbSizeY =1 << MaxTbLog2SizeY PicWidthInCtbsY = Ceil( pic_width_in_luma_samples + CtbSizeY ) PicHeightinCtbsY = Ceil( pic_height_in_luma_samples + CtbSizeY ) PicSizeInCtbsY = PicWidthInCtbsY * PicHeightInCtbsY  PicWidthInMinCbsY= pic_width_in_luma samples / MinCbSizeY  PicHeightInMinCbsY =pic_height_in_luma_samples / MinChSizeY  PicSizehInMinCbsY =PicWidthInMinCbsY * PicHeightInMinCbsY  PicSizeInSamplesY = pic_width_inluma_samples * pic_height_in_luma_samples  PicWidthInSamplesC =pic_width_in_luma_samples / SubWidthC  PicHeightInSamplesC=pic_height_in_luma_samples / SubHeightC [Fd. (BB): Currently themaximum transform size (64×64 luma samples and corresponding chromasample size) and the minimum transform size (4×4 luma samples andcorresponding chroma samples) is Fixed, pending further specificationdevelopment.] The variables CtbWidthC and CtbHeightC, which specify thewidth and height, respectively, of the array for each chroma CTB, arederived as follows:  If chroma_format_idc is equal to 0 (monochrome) orseparate colour_plane_flag is equal to 1. CtbWidthC  and CtbHeightC areboth equal to 0.  Otherwise, CtbWidthC and CtbHeightC are derived asfollows:   CtbWidthC = CtbSizeY / SubWidthC   CtbHeightC = CtbSizeY /SubHeightC For log2BlockWidth ranging from 0 to 4 and forlog2BlockHeight ranging from 0 to 4, inclusive, the up-right diagonalscan order array initialization process as specified in clause 6.5.2 isinvoked with 1 << log2BlockWidth and 1 <<log2BlockHeight as inputs, and the output is assigned to DiagScanOrder[log2BlockWidth ][ log2BlockHeight ].partition_constraints_override_enabled_flag equal to 1 specifies the presence ofpartition_constraints_override_flag in the tile group headers for tilegroups referring to the SPS. partition_constraints_override_enabled_flagequal to 0 specifies the absence of partition_constraints_override_flagin the tile group headers for tile groups referring to the SPS.

TABLE 31 Sequence parameter set RBSP semanticssps_log2_diff_min_qt_min_cb_intra_tile_group_luma specifies the defaultdifference between the base 2 logarithm of the minimum size in lumasamples of a luma leaf block resulting from quadtree splitting of a CTUand the base 2 logarithm of the minimum coding block size in lumasamples for luma CUs in tile groups with tile_group_type equal to 2 (I)referring to the SPS. When partition_constraints_override_flag is equalto 1, the default difference can be overridden bytile_group_log2_diff_min_qt_min_cb_luma present in the tile group headerof the tile groups referring to the SPS. The value ofsps_log2_diff_min_qt_min_cb_intra_tile_group_luma shall be in the rangeof 0 to CtbLog2SizeY − MinCbLog2SizeY, inclusive. The base 2 logarithmof the minimum size in luma samples of a luma leaf block resulting fromquadtree splitting oft CTU is derived as follows:  MinQtLog2SizeIntraY =sps_log2_diff_min_qt_min_cb_intra_tile_group_luma +  MinCbLog2SizeYsps_log2_diff_min_qt_min_cb_inter_tile_group specifies the defaultdifference between the base 2 logarithm of the minimum site in lumasamples of a luma leaf block resulting from quadtree splitting of a CTUand the base 2 logarithm of the minimum luma coding block size in lumasamples for luma CUs in tile groups with tile_group_type equal to 0 (B)or 1 (P) referring to the SPS. When partition_constraints_override_flagis equal to 1, the default difference can be overridden bytile_group_log2_diff_min_qt_min_cb_luma present in the tile group headerof the tile groups referring to the SPS. The value ofsps_log2_diff_min_qt_min_cb_inter_tile_group shall be in the range of 0to CtbLog2SizeY − MinCbLog2SizeY, inclusive. The base 2 logarithm of theminimum size in luma samples of a luma leaf block resulting frontquadtree splitting of a CTU is derived as follows:  MinQtLog2SizeInterY= sps_log2_diff_min_qt_min_cb_inter_tile_group + MinCbLog2SizeYsps_max_mtt_hierarchy_depth_inter_tile_groups specifies the defaultmaximum hierarchy depth for coding units resulting from multi-type treesplitting of a quadtree leaf in tile groups with tile_group_type equalto 0 (B) or 1 (P) referring to the SPS. Whenpartition_constraints_override_flag is equal to 1, the default maximumhierarchy depth can be overridden bytile_group_max_mtt_hierarchy_depth_luma present in the tile group headerof the tile groups referring to the SPS. The value ofsps_max_mtt_hierarchy_depth_inter_tile_groups shall be in the range of 0to CtbLog2SizeY − MinCbLog2SizeY, inclusive.sps_max_mtt_hierarcity_depth_intra_tile_groups_luma specifies thedefault maximum hierarchy depth for coding units resulting frommulti-type tree splitting of a quadtree leaf in tile_groups withtile_group_type equal to 2 (I) referring to the SPS. Whenpartition_constraints_override_flag is equal to 1, the default maximumhierarchy depth can be overridden bytile_group_max_mtt_hierarchy_depth_luma present in the tile group headerof the tile groups referring to the SPS. The value of sps max mtthierarchy depth intra tile groups luma shall be in the range of 0 toCtbLog2SizeY − MinCbLog2SizeY, inclusive.sps_log2_diff_max_bt_min_qt_intra_tile_group_luma specifies the defaultdifference between the base 2 logarithm of the maximum size (width orheight) in luma samples of a luma coding block that can be split using abinary split and the minimum size (width or height) in luma samples of aluma leaf block resulting from quadtree splitting of a CTU in tilegroups with tile_group_type equal to 2 (I) referring to the SPS. Whenpartition_constraints_override_flag is equal to 1, the defaultdifference can be overridden by tile_group_log2_diff_max_bt_min_qt_lumapresent in the tile group header of the tile groups referring to theSPS. The value of sps_log2_diff_max_bt_min_qt_intra_tile_group_lumashall be in the range of 0 to CtbLog2SizeY − MinQtLog2SizeIntraY,inclusive. When sps_log2_diff_max_bt_min_qt_intra_tile_group_luma is notpresent, the value of sps_log2_diff_max_bt_min_qt_intra_tile_group_lumais inferred to be equal to 0.sps_log2_diff_max_tt_min_qt_intra_tile_group_luma specifics the defaultdifference between the base 2 logarithm of the maximum site (width orheight) in luma samples of a luma coding block that can be split using aternary split and the minimum size (width or height) in luma samples ofa luma leaf block resulting from quadtree splitting of a CTU in tilegroups with tile_group_type equal to 2 (I) referring to the SPS. Whenpartition_constraints_override_flag is equal to 1, the defaultdifference can be overridden by tile_group_log2_diff_max_tt_min_qt_lumapresent in the tile group header of the tile groups referring to theSPS. The value of sps log2 diff max tt min qt intra tile group lumashall be in the range of 0 to CtbLog2SizeY − MinQtLog2SizeIntraY,inclusive. When sps_log2_diff_max_tt_min_qt_intra_tile_group_luma is notpresent, the value of sps_log2_diff_max_tt_min_qt_intra_tile_group_lumais inferred to be equal to 0.

TABLE 32 Sequence parameter set RBSP semanticssps_log2_diff_max_bt_min_qt_inter_tile_group specifies the defaultdifference between the base 2 logarithm of the maximum size (width orheight) in luma samples of a luma coding block that can be split using abinary split and the minimum size (width or height) in luma samples of aluma leaf block resulting from quadtree splitting of a CTU in tilegroups with tile_group_type equal to 0 (B) or 1 (P) referring to theSPS. When partition_constraints_override_ flag is equal to 1, thedefault difference can be overridden bytile_group_log2_diff_max_bt_min_qt_luma present in the tile group headerof the tile groups referring to the SPS. The value of sps log2 diff maxbt min qt inter tile group shall be in the range of 0 to CtbLog2SizeY −MinQtLog2SizeInterY, inclusive. Whensps_log2_diff_max_bt_min_qt_inter_tile_group is not present, the valueof sps_log2_diff_max_bt_min_qt_inter_tile_group is inferred to be equalto 0. sps_log2_diff_max_tt_min_qt_inter_tile_group specifies the defaultdifference between the base 2 logarithm of the maximum size (width orheight) in luma samples of a luma coding block that can be split using aternary split and the minimum size (width or height) in luma samples ofa luma leaf block resulting front quadtree splitting of a CTU in tilegroups with tile_group_type equal to 0 (B) or 1 (P) referring to theSPS. When partition_constraints_override_ flag is equal to 1, thedefault difference can be overridden bytile_group_log2_diff_max_tt_min_qt_luma present in the tile group headerof the tile groups referring to the SPS. The value ofsps_log2_diff_max_tt_min_qt_inter_tile_group shall be in the range of 0to CtbLog2SizeY − MinQtLog2SizeInterY, inclusive. Whensps_log2_diff_max_tt_min_qt_inter_tile_group is not present, the valueof sps_log2_diff_max_tt_min_qt_inter_tile_group is inferred to be equalto 0. sps_log2_diff_min_qt_min_ch_intra_tile_group_chroma specifies thedefault difference between the base 2 logarithm of the minimum size inluma samples of a chroma leaf block resulting from quadtree splitting ofa chroma CTU with treeType equal to DUAL_TREE_CHROMA and the base 2logarithm of the minimum coding block size in luma samples for chromaCUs with treeType equal to DUAL_TREE_CHROMA in tile groups withtile_group_type equal to 2 (I) referring to the SPS. Whenpartition_constraints_override_ flag is equal to 1, the defaultdifference can be overridden bytile_group_log2_diff_min_qt_min_cb_chroma present in the tile groupheader of the tile groups referring to the SPS. The value ofsps_log2_diff_min_qt_min_cb_intra_tile_group_chroma shall be in the range of 0 toCtbLog2SizeY − MinCbLog2SizeY, inclusive. When not present, the value ofsps_log2_diff_min_qt_min_cb_intra_tile_group_chroma is inferred to beequal to 0. The base 2 logarithm of the minimum size in luma samples ofa chrome leaf block resulting from quadtree splitting of a CTU withtreeType equal to DUAL_TREE_CHROMA is derived as follows: MinQtLog2SizeIntraC −sps_log2_diff_min_qt_min_cb_intra_tile_group_chroma +  MinCbLog2SizeYsps_man_mtt_hierarchy_depth_intra_tile_groups_chroma specifies thedefault maximum hierarchy depth for chroma coding units resulting frommulti-type tree splitting of a chroma quadtree leaf with treeType equalto DUAL_TREE_CHROMA in tile groups with tile_group_type equal to 2 (I)referring to the SPS. When partition_constraints_override_ flag is equalto 1, the default maximum hierarchy depth can be overridden bytile_group_max_mtt_hierarchy_depth_chroma present in the tile groupheader of the tile groups referring to the SPS. The value ofsps_max_mtt_hierarchy_depth_intra_tile_groups_chroma shall be in therange of 0 to CtbLog2SizeY −MinCbLog2SizeY, inclusive. When not present, the value ofsps_max_mtt_hierarchy_depth_intra_tile_groups_chroma is inferred to beequal to 0. sps_log2_diff_max_bt_min_qt_intra_tile_group_chromaspecifies the default difference between the base 2 logarithm of themaximum size (width or height) in luma samples of mm chrome coding blockthat can be split using a binary split and the minimum size (width orheight) in luma samples of a chroma leaf block resulting from quadtreesplitting of a chroma CTU with treeType equal to DUAL TREE CHROMA intile groups with tile_group_type equal to 2 (I) referring to the SPS.When partition_constraints_override_flag is equal to 1, the defaultdifference can be overridden bytile_group_log2_diff_max_bt_min_qt_chroma present in the tile groupheader of the tile groups referring to the SPS. The value ofsps_log2_diff_max_bt_min_qt_intra_tile_group_chroma shall be in the range of 0 toCtbLog2SizeY − MinQtLog2SizeIntraC, inclusive. Whensps_log2_diff_max_bt_min_qt_intra_tile_group_chroma is not present, the value ofsps_log2_diff_max_bt_min_qt_intra_tile_group_chroma is inferred to beequal to 0.

TABLE 33 Sequence parameter set RBSP semanticssps_log2_diff_max_tt_min_qt_intra_tile_group_chroma specifies thedefault difference between the base 2 logarithm of the maximum size(width or height) in luma samples of a chroma coding block that can besplit using a ternary split and the minimum size (width or height) inluma samples of a chroma leaf block resulting from quadtree splitting ofa chroma CTU with treeType equal to DUAL_TREE_CHROMA in tile groups withtile_group_type equal to 2 (I) referring to the SPS. Whenpartition_constraints_override_flag is equal to 1, the defaultdifference can be overridden bytile_group_log2_diff_max_tt_min_qt_chroma present in the tile groupheader of the tile groups referring to the SPS. The value ofsps_log2_diff_max_tt_min_qt_intra_tile_group_chroma shall be in the range of 0 toCtbLog2SizeY − MinQtLog2SizeIntraC, inclusive. Whensps_log2_diff_max_tt_min_qt_intra_tile_group_chroma is not present, the value ofsps_log2_diff_max_tt_min_qt_intra_tile_group_chroma is inferred to beequal to 0. sps_sao_enabled_flag equal to 1 specifies that the sampleadaptive offset process is applied to the reconstructed picture afterthe deblocking filter process, sps sao enabled flag equal to 0 specifiesthat the sample adaptive offset process is not applied to thereconstructed picture after the deblocking filter process.sps_alf_enabled_flag equal to 0 specifics that the adaptive loop filteris disabled, sps alf enabled flag equal to 1 specifies that the adaptiveloop filter is enabled. pcm_enabled_flag equal to 0 specifies thatPCM-related syntax (pcm_sample_bit_depth_luma_minus1,pcm_sample_bit_depth_chroma_minus1,log2_min_pcm_luma_coding_block_size_minus3,log2_diff_max_min_pcm_luma_coding_block_size,pcm_loop_filter_disabled_flag, pcm_flag, pcm_alignment_zero_bit syntaxelements and pcm_sample( ) syntax structure) is not present in the CVS.NOTE 2 When MinCbLog2SizeY is equal to 6 and pcm_enabled_flag is equalto 1, PCM sample data-related syntax (pcm flag. pcm alignment zero bitsyntax elements and pcm sample( ) syntax structure) is not present inthe CVS, because the maximum size of coding blocks that can convey PCMsample data-related syntax is restricted to be less than or equal toMin( CtbLog2SizeY, 5 ). Hence, MinCbLog2SizeY equal to 6 withpcm_enabled_flag equal to 1 is not an appropriate setting to convey PCMsample data in the CVS. pcm_sample_bit_depth_luma_minus1 specifies thenumber of bits used to represent each of PCM sample values of the lumacomponent as follows: PcmBitDepth_(Y) = pcm_sample_bit_depth_luma_minus1− 1 The value of PcmBitDepth_(Y) shall be less than or equal to thevalue of BitDepth_(Y). pcm_sample_bit_depth_chroma_minus1 specifies thenumber of bits used to represent each of PCM sample values of the chromacomponents as follows: PcmBitDepth_(C) −pcm_sample_bit_depth_chroma_minus1 + 1 The value of PcmBitDepth_(C)shall be less than or equal to the value of BitDepth_(C). WhenChromaArrayType is equal to 0, pcm_sample_bit_depth_chroma_minus1 is notused in the decoding process and decoders shall ignore its value.log2_min_pcm_luma_coding_block_size_minus3 plus 3 specifies the minimumsize of coding blocks with pcm_flag equal to 1. The variableLog2MinlpcmCbSizeY is set equal tolog2_min_pcm_luma_coding_block_size_minus3 + 3. The value ofLog2MinlpcmCbSizeY shall be in the range of Min( MinCbLog2SizeY, 5 ) toMin( CtbLog2SizeY, 5 ), inclusive.log2_diff_max_min_pcm_luma_coding_block_size specifies the differencebetween the maximum and minimum size of coding blocks with pcm_flagequal to 1. The variable Log2MaxlpcmCbSizeY is set equal tolog2_diff_max_min_pcm_luma_coding_block_size + Log2MinlpcmCbSizeY. Thevalue of Log2MaxlpcmCbSizeY shall he less than or equal to Min(CtbLog2SizeY, 5 ). pcm_loop_filter_disabled_flag specifies whether theloop filter process is disabled on reconstructed samples in a codingunit with pcm_flag equal to 1 as follows: − Ifpcm_loop_filter_disabled_flag is equal to 1, the deblocking filter andsample adaptive offset filter processes on the reconstructed samples ina coding unit with pcm_flag equal to 1 are disabled. − Otherwise (pcmloop filter disabled flag value is equal to 0), the deblocking filterand sample adaptive offset filter processes on the reconstructed samplesin a coding unit with pcm_flag equal to 1 are not disabled. When pcmloop filter disabled flag is not present, it is inferred to he equal to0.

TABLE 34 Sequence parameter set RBSP semanticssps_ref_wraparound_enabled_flag equal to 1 specifies that horizontalwrap-around motion compensation is applied in inter prediction.sps_ref_wraparound_enabled_flag equal to 0 specifies that horizontalwrap-around motion compensation is not applied.sps_ref_wraparound_offset specifies the offset used for computing thehorizontal wrap-around position in luma samples, ref_wraparound_offsetshall not be equal to 0, and shall not be greater thanpic_width_in_luma_samples, and shall be an integer multiple ofMinCbSizeY. sps_temporal_mvp_enabled_flag equal to 1 specifies thattile_group_temporal_mvp_enabled_flag is present in the tile groupheaders of tile groups with tile_group_type not equal to 1 in the CVS.sps_temporal_mvp_enabled_flag equal to 0 specifies thattile_group_temporal_mvp_enabled_flag is not present in tile groupheaders and that temporal motion vector predictors are not used in theCVS. sps_sbtmvp_enabled_flag equal to 1 specifies that subblock-basedtemporal motion vector predictors may he used in decoding of pictureswith all tile groups having tile_group_type not equal to 1 in the CVS.sps sbtmvp enabled flag equal to 0 specifies that subblock-basedtemporal motion vector predictors are not used in the CVS. Whensps_sbtmvp_enabled_flag is not present, it is inferred to be equal to 0.sps_amvr_enabled_flag equal to 1 specifics that adaptive motion vectordifference resolution is used in motion vector coding, amvr_enabled_flagequal to 0 specifies that adaptive motion vector difference resolutionis not used in motion vector coding. sps_bdof_enabled_flag equal to 0specifies that the bidirectional optical flow inter prediction isdisabled. sps_bdof_enabled_flag equal to 1 specifies that thebidirectional optical flow inter prediction is enabled.sps_cclm_enabled_flag equal to 0 specifies that the cross-componentlinear model intra prediction from luma component to chroma component isdisabled. sps_cclm_enabled_flag equal to 1 specifies that the cross-component linear model intra prediction from luma component to chromacomponent is enabled. sps_mts_intra_enabled_flag equal to 1 specifiesthat tu_mts_idx indicates the usage of DCT-VIII and DST-VII transformkernels for intra coding units, sps_mts_intra_enabled_flag equal to 0specifies that tu_mts_idx does not indicate the usage of DCT-VIII andDST-VII transform kernels for intra coding units.sps_mts_inter_enabled_flag specifics that tu_mts_idx indicates the usageof DCT-VIII and DST-VII transform kernels for inter coding units,sps_mts_inter_enabled_flag equal to 0 specifies that tu_mts_idx does notindicate the usage of DCT-VIII and DST-VII transform kernels for intercoding units. sps_affine_enabled_flag specifies whether affine modelbased motion compensation can be used for inter prediction. Ifsps_affine_enabled_flag is equal to 0, the syntax shall be constrainedsuch that no affine model based motion compensation is used in the CVS,and inter_affine_flag and cu_affine_type_flag are not present in codingunit syntax of the CVS. Otherwise (sps_affine_enabled_flag is equal to1). affine model based motion compensation can be used in the CVS.sps_affine_type_flag specifies whether 6-parameter affine model basedmotion compensation can be used for inter prediction. Ifsps_affine_type_flag is equal to 0, the syntax shall be constrained suchthat no 6-parameter affine model based motion compensation is used inthe CVS, and cu_affine_type_flag is not present in coding unit syntax inthe CVS. Otherwise (sps_affine_type_flag is equal to 1), 6-parameteraffine model based motion compensation can be used in the CVS. When notpresent, the value of sps_affine_type_flag is inferred to be equal to 0.sps_gbi_enabled_flag specifies whether bi-prediction with CU weights canbe used for inter prediction. If sps_gbi_enabled_flag is equal to 0, thesyntax shall he constrained such that no bi-prediction with CU weightsis used in the CVS, and gbi_idx is not present in coding unit syntax ofthe CVS. Otherwise (sps_gbi_enabled_flag is equal to 1), bi-predictionwith CU weights can be used in the CVS. sps_cpr_enabled_flag equal to 1specifies that current picture referencing may be used in decoding ofpictures in the CVS. sps_cpr_enabled_flag equal to 0 specifies thatcurrent picture referencing is not used in the CVS. Whensps_cpr_enabled_flag is not present. it is inferred to be equal to 0.When sps_cpr_enabled_flag is equal to 1, the current decoded picture isused as a reference picture and is put at the last position in thereference picture list 0. This reference picture is marked as along-term reference picture. (Ed. (SL): long-term reference picture hasnot been introduced to VVC.) sps_ciip_enabled_flag specifies thatciip_flag may be present in the coding unit syntax for inter codingunits. sps_ciip_enabled_flag equal to 0 specifies that ciip_flag is notpresent in the coding unit syntax for inter coding units.

TABLE 35 Sequence parameter set RBSP semantics sps_triangle_enable_flagspecifics whether triangular shape based motion compensation can be usedfor inter prediction. sps_triangle_enabled_flag equal to 0 specifiesthat the syntax shall be constrained such that no triangular shape basedmotion compensation is used in the CVS, and merge_triangle_flag andmerge_triangle_idx are not present in coding unit syntax of the CVS.sps_triangle_enabled_flag equal to 1 specifies that triangular shapebased motion compensation can be used in the CVS. sps_ladf_enabled_flagequal to 1, specifics that sps_num_ladf_intervals_minus2,sps_ladf_lowest_interval_qp_offset, sps_ladf_qp_offset[ i ], andsps_ladf_delta_threshold_minus1[ i ] are present in the SPS.sps_num_ladf_intervals_minus2 plus 1 specifies the number ofsps_ladf_delta_threshold_minus1[ i ] and sps_ladf_qp_offset[ i ] syntaxelements that are present in the SPS. The value ofsps_num_ladf_intervals_minus2 shall be in the range of 0 to 3,inclusive. sps_ladf_lowest_interval_qp_offset specifies the offset usedto derive the variable qP as specified in clause 8.6.2.6.3. The value ofsps_ladf_lowest_interval_qp_offset shall be in the range of 0 to 63,inclusive. sps_ladf_qp_offset[ i ] specifies the offset array used toderive the variable qP as specified in clause 8.6.2.6.3. The value ofsps_ladf_qp_offset[ i ] shall be in the range of 0 to 63, inclusive.sps_ladf_delta_threshold_minus1[ i ] is used to compute the values ofSpsLadfIntervalLowerBound[ i ], which specifies the lower bound of thei-th luma intensity level interval. The value ofsps_ladf_delta_threshold_minus1[ i ] shall be in the range of 0 to2^(BitDepthY) − 3, inclusive. The value of SpsLadfIntervalLowerBound[ 0] is set equal to 0. For each value of i in the range of 0 tosps_num_ladf_intervals_minus2, inclusive, the variableSpsLadfIntervalLowerBound[ i + 1 ] is derived as follows:SpsLadfIntervalLowerBotind[ i + 1 ] = SpsLadfIntervalLowerBound[ i ] +sps_ladf_delta_threshold_minus1[ i ] + 1

Meanwhile, for example, at least some of the information according tothe aforementioned embodiments of the present document may be includedin the high level syntax as illustrated in Table 36 or Tables 37 to 39.Alternatively, at least some of the information according to theaforementioned embodiments of the present document may be signaled bybeing included in the high level syntax. Alternatively, at least some ofthe information according to the aforementioned embodiments may beincluded in a picture parameter set (PPS) syntax. Alternatively, atleast some of the information according to the aforementionedembodiments may be signaled by being included in the PPS syntax. Forexample, Tables 37 to 39 may consecutively represent one syntax, and thesyntax elements included in the syntax may be sequentially signaled,configured, or parsed.

TABLE 36 Descriptor pic_parameter_set_rbsp( ) { pps_pic_parameter_set_id ue(v)  pps_seq_parameter_set_id ue(v) single_tile_in_pic_flag u(1)  if( !single_tile_in_pic flag ) {  num_tile_columns_minus1 ue(v)   num_tile_rows_minus1 ue(v)  uniform_tile_spacing_flag u(1)   if( !uniform tile spacing flag ) {   for( i = 0; i < num_tile_columns_minus1; i++ )    tile_column_width_minus1[ i ] ue(v)    for( i = 0; i <num_tile_rows_minus1; i++ )     tile_row_height_minus1[ i ] ue(v)   }  loop_filter_across_tiles_enabled_flag u(1)  }  init_qp_minus26 se(v) transform_skip_enabled_flag u(1)  if ( transform_skip_enabled_flag )  log2_transform_skip_max_size_minus2 ue(v)  cu_qp_delta_enabled_flagu(1)  if( cu_qp_delta_enabled_flag )   diff_cu_qp_delta_depth ue(v) pps_cb_qp_offset se(v)  pps_cr_qp_offset se(v) pps_tile_group_chroma_qp_offsets_present_flag u(1) deblocking_filter_control_present_flag u(1)  if(deblocking_filter_control_present_flag ) {  deblocking_filter_override_enabled_flag u(1)  pps_deblocking_filter_disabled_flag u(1)   if(!pps_deblocking_filter_disabled_flag ) {    pps_beta_offset_div2 se(v)   pps_tc_offset_div2 se(v)   }  }  rbsp_trailing_bits( ) }

TABLE 37 Descriptor pic_parameter_set_rbsp( ) { pps_pic_parameter_set_id ue(v)  pps_seq_parameter_set_id u(4) pic_width_in_luma_samples ue(v)  pic_height_in_luma_samples ue(v) conformance_window_flag u(1)  if( conformance_window_flag ) {  conf_win_left_offset ue(v)   conf_win_right_offset ue(v)  conf_win_top_offset ue(v)   conf_win_bottom_offset ue(v)  } scaling_window_flag u(1)  if( scaling_window_flag ) {  scaling_win_left_offset ue(v)   scaling_win_right_offset ue(v)  scaling_win_top_offset ue(v)   scaling_win_bottom_offset ue(v)  } output_flag_present_flag u(1)  mixed_nalu_types_in_pic_flag u(1) pps_subpic_id_signalling_present_flag u(1)  if(pps_subpics_id_signalling_present_flag ) {   pps_num_subpics_minus1ue(v)   pps_subpic_id_len_minus1 ue(v)   for( i = 0; i <=pps_num_subpic_minus1; i++ )    pps_subpic_id[ i ] u(v)  }

TABLE 38  no_pic_partition_flag u(1)  if( !no_pic_partition_flag ) {  pps_log2_ctu_size_minus5 u(2)   num_exp_tile_columns_minus1 ue(v)  num_exp_tile_rows_minus1 ue(v)   for( i = 0; i <=num_exp_tile_columns_minus1; i++ )    tile_column_width_minus1[ i ]ue(v)   for( i = 0; i <= num_exp_tile_rows_minus1; i−+ )   tile_row_height_minus1[ i ] ue(v)   rect_slice_flag u(1)   if(rect_slice_flag )    single_slice_per_subpic_flag u(1)   if(rect_slice_flag && !single_slice_par_subpic_flag ) {   num_slices_in_pic_minus1 ue(v)    tile_idx_delta_present_flag u(1)   for( i = 0; i < num_slices_in_pic_minus1; i++ ) {    slice_width_in_tiles_minus1[ i ] ue(v)    slice_height_in_tiles_minus1[ i ] ue(v)     if(slice_width_in_tiles_minus1[ i ] = = 0 &&      slice_height_in_tiles_minus1[ i ] = = 0 ) {     num_slices_in_tile_minus1[ i ] ue(v)      numSlicesInTileMinus1 =num_slices_in_tile_minus1[ i ]      for( j = 0; j <numSlicesInTileMinus1; j++ )       slice_height_in_ctu_minus1[ i−+ ]ue(v)     }     if( tile_idx_delta_present_flag && i <num_slices_in_pic_minus1 )      tile_idx_delta[ i ] se(v)    }   }  loop_filter_across_tiles_enabled_flag u(1)  loop_filter_across_slices_enabled_flag u(1)  } entropy_coding_sync_enabled_flag u(1)  if( !no_pic_partition_flag |entropy_coding_sync_enabled_flag )   entry_point_offsets_present_flagu(1)  cabac_init_present_flag u(1)  for( i = 0; i < 2; i++ )  num_ref_idx_default_active_minus1[ i ] ue(v)  rpl1_idx_present_flagu(1)  init_qp_minus26 se(v)  log2_transform_skip_max_size_minus2 ue(v) cu_qp_delta_enabled_flag u(1)  pps_cb_qp_offset se(v)  pps_cr_qp_offsetse(v)  pps_joint_cbcr_qp_offset_present_flag u(1)  if(pps_joint_cbcr_qp_offset_present_flag )   pps_joint_cbcr_qp_offset_valuese(v)  pps_slice_chroma_qp_offsets_present_flag u(1) pps_cu_chroma_qp_offset_list_enabled_flag u(1)

TABLE 39  if( pps_cu_chroma_qp_offset_list_enabled_flag ) {  chroma_qp_offset_list_len_minus1 ue(v)   for( i = 0; i <= chroma qpoffset list len minus1; i++ ) {    cb_qp_offset_list[ i ] se(v)   cr_qp_offset_list[ i ] se(v)    if( pps_joint_cbcr_qp_offset_presentflag )     joint_cbcr_qp_offset_list[ i ] se(v)   }  } pps_weighted_pred_flag u(1)  pps_weighted_bipred_flag u(1) deblocking_filter_control_present_flag u(1)  if(deblocking_filter_control_present_flag ) {  deblocking_fliter_override_enabled_flag u(1)  pps_deblocking_filter_disabled_flag u(1)   if(!pps_deblocking_filter_disabled_flag ) {    pps_beta_offset_div2 se(v)   pps_tc_offset_div2 se(v)   }  } constant_slice_header_params_enabled_flag u(1)  if(constant_slice_header_params_enabled_flag ) {  pps_dep_quant_enabled_idc u(2)   for( i − 0; i < 2; i++ )   pps_ref_pic_list_sps_idc[ i ] u(2)   pps_mvd_l1_zero_idc u(2)  pps_collocated_from_l0_idc u(2)  pps_six_minus_max_num_merge_cand_plus1 ue(v)  pps_max_num_merge_cand_minus_max_num_triangle_cand_plus1 ue(v)  } picture_header_extension_present_flag u(1) slice_header_extension_present_flag u(1)  pps_extension_flag u(1)  if(pps_extension_flag )   while( more_rbsp_data( ) )   pps_extension_data_flag u(1)  rbsp_trailing_bits( ) }

For example, as illustrated in Table 36 or Tables 37 to 39, theinformation represented by the syntax elements included in the PPSsyntax or semantics of the syntax elements may be represented as inTables 40 to 42.

TABLE 40 Picture parameter set RBSP semantics pps_pic_parameter_set_ididentifies the PPS for reference by other syntax elements. The value ofpps_pic_parameter_set_id shall be in the range of 0 to 63, inclusive.pps_seq_parameter_set_id specifics the value of sps_seq_parameter_set_idfor the active SPS. The value of pps_seq_parameter_set_id shall be inthe range of 0 to 15, inclusive. single_tile_in_pic_flag equal to 1specifies that there is only one tile in each picture referring to thePPS. single_tile_in_pic_flag equal to 0 specifies that there is morethan one tile in each picture referring to the PPS. It is a requirementof bitstream conformance that the value of single_tile_in_pic_flag shallbe the same for all PPSs that are activated within a CVS.num_tile_columns_minus1 plus 1 specifies the number of tile columnspartitioning the picture. num_tile_columns_minus1 shall be in the rangeof 0 to PicWidthInCtbsY − 1, inclusive. When not present, the value ofnum_tile_columns_minus1 is inferred to be equal to 0.num_tile_rows_minus1 plus 1 specifies the number of tile rowspartitioning the picture. num_tile_rows_minus1 shall be in the range of0 to PicHeightInCtbsY − 1, inclusive. When not present, the value ofnum_tile_rows_minus1 is inferred to be equal to 0. The variableNumTilesInPic is set equal to ( num_tile_columns_minus1 − 1 ) * (num_tile_rows_minus1 − 1 ). When single_tile_in_pic_flag is equal to 0.NumTilesInPic shall be greater than 1. uniform_tile_spacing_flag equalto 1 specifies that tile column boundaries and likewise tile rowboundaries are distributed uniformly across the picture.uniform_tile_spacing_flag equal to 0 specifies that tile columnboundaries and likewise tile row boundaries are not distributeduniformly across the picture but signalled explicitly using the syntaxelements tile_column_width_minus1[ i ] and tile_row_height_minus1[ i ].When not present, the value of uniform_tile_spacing_flag is inferred tobe equal to 1. tile_column_width_minus1[ i ] plus 1 specifies the widthof the i-th tile column in units of CTBs. tile_row_height_minus1[ i ]plus 1 specifies the height of the i-th tile row in units of CTBs. Thefollowing variables are derived by invoking the CTB raster and tilescanning conversion process as specified in clause 6.5.1: − The listColWidth[ i ] for i ranging front 0 to num_tile_columns_minus1,inclusive, specifying the width of the i-th tile column in units ofCTBs, − the list RowHeight[ j ] for j ranging from 0 tonum_tile_rows_minus1, inclusive, specifying the height of the j-th tilerow in units of CTBs, − the list ColBd[ i ] for i ranging from 0 tonum_tile_columns_minus1 − 1, inclusive, specifying the location of thei-th tile column boundary in units of CTBs, − the list RowBd[ j ] for jranging from 0 to num tile rows minus1 + 1, inclusive, specifying thelocation of the j-th tile row boundary in units of CTBs, − the listCtbAddrRsToTs[ etbAddrRs ] for ctbAddrRs ranging from 0 toPicSizeInCtbsY − 1, inclusive, specifying the conversion from a CTBaddress in the CTB raster scan of a picture to a CTB address in the tilescan, the list CtbAddrTsToRs[ ctbAddrTs ] for ctbAddrTs ranging from 0to PicSizeInCtbsY − 1, inclusive, specifying the conversion from a CTBaddress in the tile scan to a CTB address in the CTB raster scan of apicture, − the list TileId[ ctbAddrTs ] for ctbAddrTs ranging front 0 toPicSizeInCtbsY − 1, inclusive, specifying the conversion from a CTBaddress in tile scan to a tile ID, − the list NumCtusInTile[ tileIdx ]for tileIdx ranging from 0 to PicSizeInCtbsY − 1, inclusive, specifyingthe conversion from a tile index to the number of CTUs in the tile, −the list FirstCtbAddrTs[ tileIdx ] for tileIdx ranging front 0 toNumTilesInPic − 1, inclusive, specifying the conversion from a tile IDto the CTB address in tile scan of the first CTB in the tile, − thelists ColumnWidthInLumaSamples[ i ] for i ranging from 0 tonum_tile_columns_minus1, inclusive, specifying the width of the i-thtile column in units of luma samples, − the list RowHeightInLumaSamples[j ] for j ranging from 0 to num_tile_rows_minus1, inclusive, specifyingthe height of the j-th tile row in units of luma samples. The values ofColumnWidthInLumaSamples[ i ] for i ranging from 0 tonum_tile_columns_minus1, inclusive, and RowHeightInLumaSamples[ j ] forj ranging front 0 to num_tile_rows_minus1, inclusive, shall all begreater than 0.

TABLE 41 Picture parameter set RBSP semanticsloop_filter_across_tiles_enabled_flag equal to 1 specifies that in-loopfiltering operations may be performed across tile boundaries in picturesreferring to the PPS. loop_filter_across_tiles_enabled_flag equal to 0specifies that in-loop filtering operations are not performed acrosstile boundaries in pictures referring to the PPS. The in- loop filteringoperations include the deblocking filter, sample adaptive offset filter,and adaptive loop filter operations. When not present, the value ofloop_filter_across_tiles_enabled_flag is inferred to be equal to 1.init_qp_minus26 plus 26 specifies the initial value of TileGroupQp_(Y)for each tile group referring to the PPS. The initial value ofTileGroupQp_(Y) is modified at the tile group layer when a non-zerovalue of tile_group_qp_delta is decoded. The value of init_qp_minus26shall be in the range of −( 26 − QpBdOffset_(Y) ) to −37, inclusive.transform_skip_enabled_flag equal to 1 specifies that tu_mts_idxindicates skipping the transform for luma residual blocks in the codingunit syntax, transform_skip_enabled_flag equal to 0 specifies thattu_mts_idx does not indicate skipping the transform for luma residualblocks coding syntax. log2_transform_skip_max_size_minus2 specifies themaximum block size used for transform skip, and shall be in the range of0 to 3. If transform_skip_enabled_flag is equal to 0 or not present, thevalue of log2_transform_skip_max_size_minus2 is inferred to be equal to0. The variable MaxTsSize is set to 1 <<(log2_transform_skip_max_size_minus2 + 2). cu_qp_delta_enabled_flagequal to 1 specifies that the diff_cu_qp_delta_depth syntax element ispresent in the PPS and that cu_qp_delta_abs may be present in thetransform unit syntax. cu_qp_delta_enabled_flag equal to 0 specifiesthat the diff_cu_qp_delta_depth syntax element is not present in the PPSand that cu_qp_delta_abs is not present in the transform unit syntax.diff_cu_qp_delta_depth specifies the coding tree depth differencebetween the coding units of minimum coding tree depth and coding unitsof maximum coding tree depth that convey cu_qp_delta_abs andcu_qp_delta_sign_flag. The value range of diff_cu_qp_delta_depth isspecified as follows: − If tile_group_type is equal to 1, the value ofdiff_cu_qp_delta_depth shall be in the range of 0 tolog2_ctu_size_minus2 − log2_min_qt_size_intra_tile_groups_minus2 +MaxMttDepthY. inclusive. − Otherwise (tile_group_type is not equal to1), the value of diff_cu_qp_delta_depth shall be in the range of 0 tolog2_ctu_size_minus2 − log2_min_qt_size_inter_tile_groups_minus2 +MaxMttDepthY, inclusive. When not present, the value ofdiff_cu_qp_delta_depth is inferred to be equal to 0. [Ed. (BB): Theissue here is that MaxMttDepthY is derived on tile-group-level. In caseof partition_constraints_override_enabled_flag equal to 1, one wouldneed to parse the tile group header in order to know the value ofMaxMttDepthY.] pps_cb_qp_offset and pps_cr_qp_offset specify the offsetsto the luma quantization parameter Qp′_(Y) used for deriving Qp′_(Cb),and Qp′_(Cr), respectively. The values of pps_cb_qp_offset andpps_cr_qp_offset shall be in the range of −12 to +12, inclusive. WhenChromaArrayType is equal to 0, pps_cb_qp_offset and pps_cr_qp_offset arenot used in the decoding process and decoders shall ignore their value.pps_tile_group_chroma_qp_offsets_present_flag equal to 1 indicates thatthe tile_group_cb_qp_offset and tile_group_cr_qp_offset syntax elementsare present in the associated tile group headers.pps_tile_group_chroma_qp_offsets_present_flag equal to 0 indicates thatthese syntax elements are not present in the associated tile groupheaders. When ChromaArrayType is equal to 0,pps_tile_group_chroma_qp_offsets_present_flag shall be equal to 0.deblocking_filter_control_present_flag equal to 1 specifies the presenceof deblocking filter control syntax elements in the PPS,deblocking_filter_control_present_flag equal to 0 specifies the absenceof deblocking filter control syntax elements in the PPS.deblocking_filter_override_enabled_flag equal to 1 specifies thepresence of deblocking_filter_override_flag in the tile group headersfor pictures referring to the PPS,deblocking_filter_override_enabled_flag equal to 0 specifies the absenceof deblocking_filter_override_flag in the tile group headers forpictures referring to the PPS. When not present, the value ofdeblocking_filter_override_enabled_flag is inferred to be equal to 0.

TABLE 42 Picture parameter set RBSP semanticspps_deblocking_filter_disabled_flag equal to 1 specifics that theoperation of deblocking filter is not applied for tile groups referringto the PPS in which tile_group_deblocking_filter_disabled_flag is notpresent. pps_deblocking_filter_disabled_flag equal to 0 specifies thatthe operation of the deblocking filter is applied for tile groupsreferring to the PPS in which tile_group_deblocking_filter_disabled_flagis not present. When not present the value ofpps_deblocking_filter_disabled_flag is inferred to be equal to 0.pps_beta_offset_div2 and pps_te_offset_div2 specify the defaultdeblocking parameter offsets for β and tC (divided by 2) that areapplied for tile groups referring to the PPS, unless the defaultdeblocking parameter offsets are overridden by the deblocking parameteroffsets present in the tile group headers of the tile groups referringto the PPS. The values of pps_beta_offset_div2 and pps_te_offset_div2shall both be in the range of −6 to 6, inclusive. When not present, thevalue of pps_beta_offset_div2 and pps_tc_offset_div2 are inferred to beequal to 0.

Meanwhile, for example, at least some of the information according tothe aforementioned embodiments of the present document may be includedin a coding unit syntax as illustrated in Tables 43 to 47.Alternatively, at least some of the information according to theaforementioned embodiments of the present document may be signaled bybeing included in the coding unit syntax. For example, Tables 43 to 47may consecutively represent one syntax, and the syntax elements includedin the syntax may be sequentially signaled, configured, or parsed.

TABLE 43 Descriptor coding_unit( x0, y0, cbWidth, cbHeight, cqtDepth,treeType, modeType ) {  chType = treeType = = DUAL_TREE_CHROMA ? 1 : 0 if( slice type != I | | spa ibc enabled flag ) {   if( treeType !=DUAL_TREE_CHROMA &&    ( ( !( cbWidth − − 4 && cbHeight − − 4 ) &&modeType !− MODE_TYPE_INTRA )     | | ( sps_ibc_enabled_flag && cbWidth<− 64 && cbHeight <− 64 ) ) )    cu_skip_flag[ x0 ][ y0 ] ae(v)   if(cu_skip_flag[ x0 ][ y0 ] = = 0 && slice_type != I    && !( cbWidth 4 &&cbHeight 4 ) && modeType MODE_TYPE_ALL )     pred_mode_flag ae(v)   if(( ( slice_type − − I && cu_skip_flag[ x0 ][ y0 ] − −0) | |    (slice_type != I && ( CuPredMode[ chType ][ x0 ][ y0 ] != MODE_INTRA | |    ( ( ( cbWidth = = 4 && cbHeight = = 4 ) | modeType = =MODE_TYPE_TNTRA )      && cu_skip_flag[ x0 ][ y0 ] 0 ) ) ) ) &&   cbWidth <= 64 && cbHeight <= 64 && modeType != MODE_TYPE_INTER &&   sps ibc enabled flag && treeType != DUAL TREE CHROMA )   pred_mode_ibc_flag ae(v)  }  if( CuPredMode[ chType ][ x0 ][ y0 ] = =MODE_INTRA && sps_palette_enabled_flag &&   cbWidth <= 64 && cbHeight <=64 && cu_skip_flag[ x0 ][ y0 ] = = 0 &&   modeType != MODE TYPE INTER )   pred_mode_plt_flag ae(v)  }  if( CuPredMode[ chType ][ x0 ][ y0 ] − −MODE_INTRA && sps_act_enabled_flag &&   treeType = = SINGLE_TREE )  cu_act_enabled_flag ae(v)  if( CuPredMode[ chType ][ x0 ][ y0 ] = =MODE_INTRA | |   CuPredMode[ chType ][ x0 ][ y0 ] − − MODE_PLT) {   if(treeType − − SINGLE_TREE | | treeType − − DUAL_TREE_LUMA ) {    if(pred_mode_plt_flag ) {     palette_coding( x0, y0, cbWidth, cbHeight,treeType )    } else {     if( sps bdpcm enabled flag &&       cbWidth<= MaxTsSize && cbHeight <= MaxTsSize )      intra_bdpcm_luma_flag ae(v)    if( intra bdpcm luma flag )      intra_bdpcm_luma_dir_flag ae(v)    else{      if( sps_mip_enabled_flag )       intra_mip_flag[ x0 ][ y0] ae(v)      if( intra mip flag[ x0 ][ y0 ] ) {      intra_mip_transposed[ x0 ][ y0 ] ae(v)       intra_mip_mode[ x0 ][y0 ] ae(v)      } else {

TABLE 44       if( sps_mrl_enabled_flag && ( ( y0 % CtbSizeY ) > 0 ) )       intra_luma_ref_idx[ x0 ][ y0 ] ae(v)       if( sps isp enabledflag && intra luma ref idx[ x0 ][ y0 ] = = 0 &&        ( cbWidth <=MaxTbSizeY && cbHeight <= MaxTbSizeY ) &&        ( cbWidth * cbHeight >MinTbSizeY * MinTbSizeY ) && !cu_act_enabled_flag )       intra_subpartitions_mode_flag[ x0 ][ y0 ] ae(v)       if(intra_subpartitions_mode_flag[ x0 ][ y0 ] = = 1 )       intra_subpartitions_split_flag[ x0 ][ y0 ] ae(v)       if(infra_luma_ref_idx[ x0 ][ y0 ] = = 0 )        intra_luma_mpm_flag[ x0 ][y0 ] ae(v)       if( intra_luma_mpm_flag[ x0 ][ y0] ) {        if(intra_luma_ref_idx[ x0 ][ y0 ] − − 0 )        intra_luma_not_planar_flag[ x0 ][ y0 ] ae(v)        if(intra_luma_not_planar_flag[ x0 ][ y0 ] )         intra_luma_mpm_idx[ x0][ y0 ] ae(v)       } else        intra_luma_mpm_remainder[ x0 ][ y0 ]ae(v)      }     }    }   }    if( ( treeType − − SINGLE_TREE | |treeType − − DUAL_TREE_CHROMA ) &&      ChromaArrayType != 0 ) {     if(pred mode plt flag && treeType = = DUAL TREE CHROMA )     palette_coding( x0, y0, cbWidth / SubWidthC, cbHeight / SubHeightC,treeType )     else {      if( !cu_act_enabled_flag) {       if( cbWidth<= MaxTsSize && cbHeight <= MaxTsSize &&       sps_bdpcm_chroma_enabled_flag ) {        intra_bdpcm_chroma_flagae(v)        if( intra_bdpcm_chroma_flag )        intra_bdpcm_chroma_dir_flag ae(v)       } else {        if(CclmEnabled )         cclm_mode_flag ae(v)        if( cclm mode flag )        cclm_mode_idx ae(v)        else         intra_chroma_pred_modeae(v)       }      }     }    }  } else if( treeType != DUAL_TREE_CHROMA) { /* MODE_INTER or MODE_IBC */   if( cu_skip_flag[ x0 ][ y0 ] − − 0 )   general_merge_flag[ x0 ][ y0 ] ae(v)   if( general_merge_flag[ x0 ][y0 ] )    merge_data( x0, y0, cbWidth, cbHeight, chType )   else if(CuPredMode[ chTtpe ][ x0 ][ y0 ] = = MODE_IBC ) {

TABLE 45    mvd_coding( x0, y0, 0, 0 )    if( MaxNumIbcMergeCand > 1 )    mvp_l0_flag[ x0 ][ y0 ] ae(v)    if( sps_amvr_enabled_flag &&      (MvdL0[ x0 ][ y0 ][ 0 ] != 0 | | MvdL0[ x0 ][ y0 ][ 1 ] != 0 ) )    amvr_precision_idx[ x0 ][ y0 ] ae(v)   } else {    if( slice_type −− B )     inter_pred_idc[ x0 ][ y0 ] ae(v)    if(sps_affine_enabled_flag && cbWidth >= 16 && cbHeight >= 16) {    inter_affine_flag[ x0 ][ y0 ] ae(v)     if( sps_affine_type_flag &&inter_affine_flag[ x0 ][ y0 ] )      cu_affine_type_flag[ x0 ][ y0 ]ae(v)    }    if( sps_smvd_enabled_flag && !mvd_l1_zero_flag &&     inter_pred_idc[ x0 ][ y0 ] = = PRED_B1 &&      !inter_affine_flag[x0 ][ y0 ] && RefIdxSymL0 >−1 && RefIdxSymL1 >−1 )     sym_mvd_flag[ x0][ y0 ] ae(v)    if( inter_pred_idc[ x0 ][ y0] !− PRED_L1 ) {     if(NumRefIdxActive[ 0 ] > 1 && !svm mvd flag[ x0 ][ y0 ] )      ref_idx_l0[x0 ][ y0 ] ae(v)     mvd_coding( x0, y0, 0, 0 )     if( MotionModelIdc[x0 ][ y0 ] > 0 )      mvd_coding( x0, y0, 0, 1)     if( MotionModelIdc[x0 ][ y0 ] > 1 )      mvd coding( x0, y0, 0, 2 )     mvp_l0_flag[ x0 ][y0 ] ae(v)    } else {     MvdL0[ x0 ][ y0 ][ 0 ] = 0     MvdL0[ x0 ][y0 ][ 1 ] = 0    }    if( inter_pred_idc[ x0 ][ y0 ] != PRED_L0 ) {    if( NumRefIdxActive[ 1 ] > 1 && !sym_mvd_flag[ x0 ][ y0 ] )     ref_idx_l1[ x0 ][ y0 ] ae(v)     if( mvd_l1_zero_flag &&inter_pred_idc[ x0 ][ y0 ] = = PRED_B1 ) {      MvdL1[ x0 ][ y0 ][ 0 ] =0      MvdL1[ x0 ][ y0 ][ 1 ] − 0      MvdCpL1[ x0 ][ y0 ][ 0 ][ 0 ] = 0     MvdCpL1[ x0 ][ y0 ][ 0 ][ 1 ] = 0      MvdCpL1[ x0 ][ y0 ][ 1 ][ 0] − 0      MvdCpL1[ x0 ][ y0 ][ 1 ][ 1 ] − 0      MvdCpL1[ x0 ][ y0 ][ 2][ 0 ] − 0      MvdCpL1[ x0 ][ y0 ][ 2 ][ 1 ] − 0     } else {      if(sym mvd flag[ x0 ][ y0 ] ) {       MvdL1[ x0 ][ y0 ][ 0 ] − − MvdL0[ x0][ y0 ][ 0 ]       MvdL1[ x0 ][ y0 ][ 1 ] − MvdL0[ x0 ][ y0 ][ 1 ]     } else       mvd_coding( x0, y0, 1, 0 )

TABLE 46      if( MotionMode1Idc[ x0 ][ y0 ] > 0 )       mvd_coding( x0,y0, 1, 1 )      if(MotionMode1Idc[ x0, ][ y0 ] > 1 )       mvd_coding(x0, y0, 1, 2 )     }     mvd_l1_flag[ x0 ][ y0 ] ae(v)    } else {    MvdL1[ x0 ][ y0 ][ 0 ] = 0     MvdL1[ x0 ][ y0 ][ 1 ] = 0    }   if( ( sps_amvr_enabled_flag && inter_affine_flag[ x0 ][ y0 ] − − 0 &&    ( MvdL0[ x0 ][ y0 ][ 0 ] !− 0 | | MvdL0[ x0 ]][ y0 ][ 1 ] !− 0 | |     MvdL1[ x0 ][ y0 ][ 0 ] !− 0 | MvdL1[ x0 ][ y0 ][ 1 ] !− 0 ) ) | |    ( sps_affine_amvr_enabled_flag && inter_affine_flag[ x0 ][ y0 ] = =1 &&     ( MvdCpL0[ x0 ][ y0 ][ 0 ][ 0 ] != 0 | | MvdCpL0[ x0 ][ y0 ][ 0][ 1 ] != 0 | |      MvdCpL1[ x0 ][ y0 ][ 0 ][ 0 ] !− 0 | | MvdCpL1[ x0][ y0 ][ 0 ][ l ] !− 0 | |      MvdCpL0[ x0 ][ y0 ][ 1 ][ 0 ] != 0 | |MvdCpL0[ x0 ][ y0 ][ 1 ][ 1 ] != 0 | |      MvdCpL1[ x0 ][ y0 ][ 1 ][ 0] != 0 | | MvdCpL1[ x0 ][ y0 ][ 1 ][ 1 ] != 0 | |      MvdCpL0[ x0 ][ y0][ 2 ][ 0 ] != 0 | | MvdCpL0[ x0 ][ y0 ][ 2 ][ 1 ] != 0 | |     MvdCpL1[ x0 ][ y0 ][ 2 ][ 0 ] != 0 | | MvdCpL1[ x0 ][ y0 ][ 2 ][ 1] != 0 ) ) {     amvr_flag[ x0 ][ y0 ] ae(v)     if( amvr_flag[ x0 ][ y0] )      amvr_precision_idx[ x0 ][ y0 ] ae(v)    }    if(sps_bcw_enabled_flag && inter_pred_idc[ x0 ][ y0 ] = = PRED_BI &&    luma_weight_l0_flag[ ref_idx_l0 [ x0 ][ y0 ] ] = = 0 &&    luma_weight_l1_flag[ ref_idx_l1 [ x0 ][ y0 ] ] − − 0 &&    chroma_weight_l0_flag[ ref_idx_l0 [ x0 ][ y0 ] ] − − 0 &&    chroma_weight_l1_flag[ ref_idx_l1 [ x0 ][ y0 ] ] = = 0 &&    cbWidth * cbHeight >= 256 )     bcw_idx[ x0 ][ y0 ] ae(v)  } } if(CuPredMode[ chType ][ x0 ][ y0 ] !− MODE_INTRA && !pred_mode_plt_flag && general_merge_flag[ x0 ][ y0 ] = = 0 )  cu_cbf ae(v)

TABLE 47 if( cu_cbf ) {  if( CuPredMode[ chType ][ x0 ][ y0 ][ = = MODEINTER && sps sbt enabled flag    && !clip_flag[ x0 ][ y0 ] &&!MergeTriangleFlag[ x0 ][ y0 ]    && cbWidth <= MaxTbSizeY && cbHeight<= MaxTbSizeY ) {   allowSbtVerH − cbWidth >− 8   allowSbtVerQ =cbWidth >= 16   allowSbtHorQ − cbHcight >− 8   allowSbtHorQ =cbHeight >= 16   if( allowSbtVerH | | allowSbtHorH )    cu_sbt_flagae(v)   if( cu_sbt_flag ) {    if( ( allowSbtVerH | | allowSbtHorH ) &&( allowSbtVerQ | | allowSbtHorQ ) )     cu_sbt_quad_flag ae(v)    if (cu_sbt_quad_flag && allowSbtVerQ && allowSbtHorQ ) | |     (!cu_sbt_quad_flag && allowSbtVerH && allowSbtHorH ) )    cu_sbt_horizontal_flag ae(v)    cu_sbt_pos_flag ae(v)   }  }  if(sps_act_enabled_flag && CuPredMode[ chType ][ x0 ][ y0 ] !− MODE_INTRA&&   treeType − − SINGLE_TREE )   cu_act_enabled_flag  LfnstDcOnly = 1 LfnstZeroOutSigCoeffFlag = 1  MtsZeroOutSigCoeffFlag − 1 transform_tree( x0, y0, cbWidth, cbHeight, treeType, chType ) lfnstWidth ( treeType  DUAL_TREE_CHROMA ) ? cbWidth / SubWidthC : ( (IntraSubPartitionsSplitType = = ISP_VER_SPLIT ) ? cbWidth / NumIntraSubPartitions : cbWidth )  lfnstHeight = ( treeType = = DUALTREE CHROMA ) ? cbHeight / SubHeightC : ( ( IntraSubPartitionsSplitType= = ISP HOR SPLIT) ? cbHeight /  NumIntraSubPartitions : cbHeight )  if(Min( lfnstWidth, lfnstHeight ) >= 4 && sps_lfnst_enabled_flag = = 1 &&  CuPredMode[ chType ][ x0 ][ y0 ] − − MODE_INTRA &&  transform_skip_flag[ x0 ][ y0 ][ 0 ] = = 0 &&   ( treeType != DUALTREE CHROMA | | !intra mip flag[ x0 ][ y0 ] | |    Min( lfnstWidth,lfnstHeight ) >= 16 ) &&   Max( cbWidth, cbHeight ) <− MaxTbSizeY) {  if( ( IntraSubPartitionsSplitType ! ISP_NO_SPLIT | | LfnstDcOnly  0 )&&    LfnstZeroOutSigCoeffFlag = = 1 )    lfnst_idx ae(v)  }  if(treeType != DUAL TREE CHROMA && lfnst idx = = 0 &&  transform_skip_flag[ x0 ][ y0 ][ 0 ] = = 0 && Max( cbWidth, cbHeight )<= 32 &&   IntraSubPartitionsSplit[ x0 ][ y0 ] − − ISP_NO_SPLIT &&cu_sbt_flag − − 0 &&   MtsZeroOutSigCoeffElag − − 1 && tu_cbf_luma[ x0][ y0 ] ) {   if( ( ( CuPredMode[ chType ][ x0 ][ y0 ] = = MODE_INTER &&   sps_explicit_mts inter_enabled_flag ) | |    ( CuPredMode[ chType ][x0 ][ y0 ] = = MODE_INTRA &&    sps_explicit_mts_intra_enabled_flag ) ))    mts_idx ae(v)  } }

For example, as illustrated in Tables 43 to 47, the informationrepresented by the syntax elements included in the coding unit syntax orsemantics of the syntax elements may be represented as in Tables 48 to51. Table 48 is illustrated in FIG. 18 , Table 49 is illustrated in FIG.19 , and Table 50 is illustrated in FIG. 20 .

TABLE 51 Coding unit semantics gbi_idx[ x0 ][ y0 ] specifies the weightindex of bi-prediction with CU weights. The array indices x0, y0 specifythe location ( x0, y0 ) of the top-left luma sample of the consideredcoding block relative to the top-left luma sample of the picture. Whengbi_idx[ x0 ][ y0 ]is not present, it is inferred to be equal to 0.cu_cbf equal to 1 specifies that the transform_tree( ) syntax structureis present for the current coding unit. cu_cbf equal to 0 specifies thatthe transform_tree( ) syntax structure is not present for the currentcoding unit. When cu_cbf is not present, it is inferred as follows: - Ifcu_skip_flag[ x0 ][ y0 ]is equal to 1, cu_cbf is inferred to be equal to0. - Otherwise, cu_cbf is inferred to be equal to 1.

Meanwhile, for example, at least some of the information according tothe aforementioned embodiments of the present document may be includedin a transform unit syntax as illustrated in Table 52 or Tables 53 and54. Alternatively, at least some of the information according to theaforementioned embodiments of the present document may be signaled bybeing included in the transform unit syntax. For example, Tables 53 and54 may consecutively represent one syntax, and the syntax elementsincluded in the syntax may be sequentially signaled, configured, orparsed.

TABLE 52 Descriptor transform_unit( x0, y0, tbWidth, tbHeight, treeType) {  if( treeType = = SINGLE_TREE | | treeType = = DUAL_TREE_LUMA )  tu_cbf_luma[ x0 ][ y0 ] ae(v)  if( treeType = = SINGLE_TREE || treeType = = DUAL_TREE_CHROMA ) {   tu_cbf_cb[ x0 ][ y0 ] ae(v)  tu_cbf_cr[ x0 ][ y0 ] ae(v)  }  if( ( tu_cbf_luma[ x0 ][ y0 ] || tu_cbf_cb[ x0 ][ y0 ] | tu_cbf_cr[ x0 ][ y0 ] ) &&  treeType != DUAL_TREE_CHROMA ) {   if(cu_qp_delta_enabled_flag && !IsCuQpDeltaCoded ){     cu_qp_delta_absae(v)     if( cu_gp_delta_abs )      cu_qp_delta_sign_flag ae(v)   }  } if( MaxMtsIdx > 0 && tu_cbf_luma[ x0 ][ y0 ] &&   treeType != DUAL_TREE CHROMA    && ( tbWidth <= 32 ) && ( tbHeight <=32 ) )   tu_mts_idx[ x0 ][ y0 ] ae(v)  if( tu_cbf_luma[ x0 ][ y0 ] )  residual_coding( x0, y0, Log2( tbWidth ), Log2( tbHeight ), 0 )  if(tu_chf cb[ x0) ][ y0 ] )   residual coding( x0, y0, Log2( tbWidth / 2 ),Log2( tbHeight / 2 ), 1 )  if( tu_cbf_cr[ x0 ][ y0 ] )  residual_coding( x0, y0, Log2( thWidth / 2 ), Log2( tbHeight / 2 ), 2) }

TABLE 53 Descriptor transform unit( x0, y0, tbWidth, tbHeight, treeType,subTuIndex, chType ) {  if( IntraSubPartitionsSplitType != ISP_NO_SPLIT&&   treeType = = SINGLE_TREE && subTuIndex = = NumIntraSubPartitions −1 ) {   xC = CbPosX[ chType ][ x0 ][ y0 ]   yC = ChPosY[ chType ][ x0 ][y0 ]   wC = CbWidth[ chType ][ x0 ][ y0 ] / SubWidthC   hC = CbHeight[chType ][ x0 ][ y0 ] / SubHeightC  } else {   xC = x0   yC = y0   wC =tbWidth / SubWidthC   hC = tbHeight / SubHeightC  }  chromaAvailable =treeType != DUAL_TREE_LUMA && ChromaArrayType != 0 &&   (IntraSubPartitionsSplitType = = ISP_NO_SPLIT | |    (IntraSubPartitionsSplitType != ISP_NO_SPLIT &&     subTuIndex = =NumIntraSubPartitions − 1 ) )  if ( treeType = = SINGLE_TREE | |treeType = = DUAL_TREE_CHROMA ) &&      ChromaArrayType != 0 ) {   if( (IntraSubPartitionsSptitType − − ISP NO SPLIT && !( cu sbt flag &&    ( (subTuIndex = = 0 && cu_sbt_pos_flag ) | |     ( subTuIndex = = 1 &&!cu_sbt_pus_flag ) ) ) ) |    ( IntraSubPartitionsSplitType !=ISP_NO_SPLIT &&    ( subTuIndex = = NumIntraSubPartitions − 1 ) ) ) {   tu_cbf_ch[ xC ][ yC ] ae(v)    tu_cbf_cr[ xC ][ yC] ae(v)   }  }  it(tree Fype = = SINGLE_TREE | | treeType = = DUAL_TREE_LUMA ) {   if( (IntraSubPartitionsSplitType = = ISP_NO_SPLIT && !( cu_sbt_flag &&    ( (subTuIndex = = && cu_sbt_pos_flag ) | |     ( subTuIndex = = 1 &&!cu_sbt_pos_flag ) ) ) &&    ( CuPredMode[ chType ][ x0 ][ y0 ] = =MODE_INTRA |     ( chromaAvailable && ( tu_cbf_cb[ xC ][ yC ] | |tu_chf_cr[ xC ][ yC ] ) ) |     CbWidth[ chType ][ x0 ][ y0 ] >MaxTbSizeY | |     CbHeight[ chType ][ x0 ][ y0 ] > MaxTbSizeY ) ) | |   ( IntraSubPartitionsSplitType != ISP_NO_SPLIT &&    ( subTuIndex <NumIntraSubPartitions − 1 | | !InferTuCbfLluma ) ) )    tu_cbf_luma[ x0][ y0 ] ae(v)   if(IntraSubPartitionsSplitType != ISP_NO_SPLIT )   InferTuCbfLuma = InferTuCbfLuma && !tu_cbf_luma[ x0 ][ y0 ] }

TABLE 54  if( ( CbWidth[ chType ][ x0 ][ y0 ] > 64 | | CbHeight[ chType][ x0 ][ y0 ] > 64 | |    tu_cbf_luma[ x0 ][ y0 ] | ( chromaAvailable &&( tu_cbf_cb[ xC ][ yC ] | |    tu_cbf_cr[ xC ][ yC ] ) ) && treeType !=DUAL_TREE_CHROMA ) {   if( cu_qp_delta_enabled_flag && !IsCuQpDeltaCoded) {     cu_qp_delta_abs ae(v)     if( cu qp delta abs )     cu_qp_delta_sign_flag ae(v)   }  }  if( ( CbWidth[ chType ][ x0 ][y0 ] > 64 | | CbHeight[ chType ][ x0 ][ y0 ] > 64 | |    (chromaAvailable && ( tu cbf cb[ xC ][ yC ] | | tu cbf cr[ xC ][ yC ] ) )) &&   treeType != DUAL_TREE_LUMA ) {   if( cu chroma qp offset enabledflag && !IsCuChromaQpOffsetCoded) {    cu_chroma_qp_offset_flag ae(v)   if( cu_chroma_qp_offset_flag && chroma_qp_offset_list_len_minus1 > 0)     cu_chroma_qp_offset_idx ae(v)   }  }  if(sps_joint_cbcr_enabled_flag && ( ( CuPredMode[ chType ][ x0 ][ y0 ] = =MODE_INTRA     && ( tu_cbf_cb[ xC ][ yC ] | tu_cbf_cr[ xC ][ yC ] ) ) ||    ( tu_cbf_cb[ xC ][ yC ] && tu_cbf_cr[ xC ][ yC ] ) ) &&chromaAvailable )    tu_joint_cbcr_residual_flag[ xC ][ yC ] ae(v)  if(tu_cbf_luma[ x0 ][ y0 ] && treeType !− DUAL_TREE_CHROMA ) {   if(sps_transform_skip_enabled_flag && !BdpcmFlag[ x0 ][ y0 ][ 0 ] &&   tbWidth <= MaxTsSize && tbHeight <= MaxTsSize &&    (IntraSubPartitionsSplit[ x0 ][ y0 ] = = ISP_NO_SPLIT ) && !cu_sbt_flag )   transform_skip_flag[ x0 ][ y0 ][ 0 ] ae(v)   if(!transform_skip_flag[ x0 ][ y ][ 0 ] )    residual_coding( x0, y0, Log2(tbWidth ), Log2( tbHeight ), 0 )   else    residual_ts_coding( x0, y0,Log2( tbWidth ), Log2( tbHeight ), 0 )  }  if( tu_cbf_cb[ xC ][ yC ] &&treeType != DUAL_TREE_LUMA ) {   if( sps_transform_skip_enabled flag &&!BdpcmFlag[ x0 ][ y0 ][ 1 ] &&    wC <= MaxTsSize && hC <= MaxTsSize &&!cu_sbt_flag )    transform_skip_flag[ xC ][ yC ][ 1 ] ae(v)   if(!transform_skip_flag[ xC ][ yC ][ 1 ] )    residual_coding( xC, yC,Log2( wC ), Log2( hC ), 1 )   else    residual_ts_coding( xC, yC, Log2(wC ), Log2( hC ), 1 )  }  if( tu cbf cr[ xC ][ yC ] && treeType != DUALTREE LUMA &&   !( tu_cbf_cb[ xC ][ yC ] && tu_joint_cbcr_residual_flag[xC ][ yC ] ) ) {   if( sps_transform_skip_enabled_flag && !BdpcmFlag[ x0][ y0 ][ 2 ]&&    wC <= MaxTsSize && hC <= MaxTsSize && !cu_sbt_flag )   transform_skip_flag[ xC ][ yC ][ 2 ] ae(v)   if(!transform_skip_flag[ xC ][ yC ][ 2 ] )    residual coding( xC, yC,Log2( wC ), Log2( hC ), 2 )   else    residual_ts_coding( xC, yC, Log2(wC ), Log2( hC ), 2 )  } }

For example, as illustrated in Table 52 or Tables 53 and 54, theinformation represented by the syntax elements included in the transformunit syntax or semantics of the syntax elements may be represented as inTable 55, which is illustrated in FIG. 21 .

Meanwhile, for example, at least some of the information according tothe aforementioned embodiments of the present document may be includedin the residual coding syntax as illustrated in Tables 6 to 9 describedabove or Tables 56 to 59. Alternatively, at least some of theinformation according to the aforementioned embodiments of the presentdocument may be signaled by being included in the transform unit syntax.For example, Tables 6 to 9 or Tables 56 to 59 may consecutivelyrepresent one syntax, and the syntax elements included in the syntax maybe sequentially signaled, configured, or parsed.

TABLE 56 Descriptor residual coding( x0, y0, log2TbWidth, log2TbHeight,cIdx ) {  last_sig_coeff_x_prefix ae(v)  last_sig_coeff_y_prefix ae(v) if( last_sig_coeff_x_prefix > 3 )   last_sig_coeff_x_suffix ae(v)  if(last_sig_coeff_y_prefix > 3 )   last_sig_coeff_y_suffix ae(v) log2SbSize = ( Min( log2Width, log2TbHeight ) < 2 ? 1 : 2 )  numSbCoeff= 1 << ( log2SbSize << 1)  lastScanPos = numSbCoeff  lastSubBlock = ( 1<< ( log2TbWidth − log2TbHeight − 2 * log2SbSize ) ) − 1  do {   if(lastScanPos = = 0 {    lastScanPos = numSbCoeff    lastSubBlock− −   }  lastScanPos− −   xS = DiagScanOrder[ log2TbWidth − log2SbSize ][log2TbHeight − log2SbSize ]      [ lastSubBlock ][ 0 ]   yS =DiagScanOrder[ log2TbWidth − log2SbSize ][ log2TbHeight − log2SbSize ]     [ lastSubBlock ][ 1 ]   xC = ( xS << log2SbSize ) +   DiagScanOrder[ log2SbSize ][ log2SbSize ][ lastScanPos ][ 0 ]   yC =( yS << log2SbSize ) +    DiagScanOrder[ log2SbSize ][ log2SbSize ][lastScanPos ][ 1 ]  } while( ( xC != LastSignificantCoeffX ) | | (yc != LastSignificantCoeffY ) )  numSigCoeff = 0  QState − 0  for( i =lastSubBlock; i >= 0; i− − ) {   startQStateSb − QState   xS =DiagScanOrder[ log2TbWidth − log2SbSize ][ log2TbHcight − log2SbSize ]     [ lastSubBlock ][ 0 ]   yS = DiagScanOrder[ log2TbWidth −log2SbSize ][ log2TbHeight − log2SbSize ]      [ lastSubBlock ][ 1 ]  inferSbDcSigCoeffFlag = 0   if( ( i < lastSubBlock ) && ( i > 0 ) ) {   coded_sub_block_flag[ xS ][ yS ] ae(v)    inferSbDcSigCoeffFlag = 1  }   firstSigScanPosSb = numSbCoeff   lastSigScanPosSb = −1  remBinsPass1 = ( log2SbSize < 2 ? 6 : 28 )   remBinsPass2 = (log2SbSize < 2 ? 2 : 4 )   firstPosMode0 − ( i − − lastSubBlock ?lastScanPos − 1 : numSbCoeff − 1)   firstPosMode1 = −1   firstPosMode2 −−I   for( n = ( i = = firstPosMode0; n >= 0 && romBinsPass1 >= 3; n− −){    xC − ( xS << log2SbSize ) + DiagScanOrder[ log2SbSize ][ log2SbSize][ n ][ 0 ]

TABLE 57    yC = ( yS << log2ShSize ) − DiagScanOrder[ log2SbSize ][log2SbSize ][ n ][ 1 ]    if( coded_sub_block_flag[ xS ][ yS ] && ( n >0 | | !inferSbDcSigCoeffFlag ) ) }     sig_coeff_flag[ xC ][ yC ] ae(v)   remBinsPass1− −    if( sig_coeff_flag[ xC ][ yC ] )    inferSbDcSigCoeffFlag − 0    }    if( sig_coeff_flag[ xC ][ yC ] )    numSigCoeff−+     abs_level_gt1_flag[ n ] ae(v)     remBinsPass1− −    if( abs_level_gt1_flag[ n ] ) {      par_level_flag[ n ] ae(v)     remBinsPass1− −      if( remBinsPass2 > 0 {       remBinsPass2− −      if( remBinsPass2 = = 0 )        firstPosMode1 = n − 1      }     }    if( lastSigScanPosSb = = −1 )      lastSigScanPosSb = n    firstSigScanPosSb = n    }    AbsLevelPass1[ xC ][ yC ] =     sig_coeff_flag[ xC ][ yC ] − par_level_flag[ n ] −abs_level_gt1_flag[ n ]    if( dep_quant_enabled_flag )     QState =QStateTransTable[ QState ][ AbsLevelPass1[ xC ][ yC ] & 1 ]    if(remBinsPass1 < 3 )     firstPosMode2 = n − 1   }   if( firstPosMode1 <firstPosMode2 )    firstPosMode1 − firstPosMode2   for( n = numSbCoeff −1; n >= firstPosMode2; n− − )    if( abs_level_gt1_flag[ n1 ] )    abs_level_gt3_flag[ n ] ae(v)   for( n = numSbCoeff − 1;n >= firstPosMode1; n− − ) {    xC − ( xS << log2SbSize ) −DiagScanOrder[ log2SbSize ][ log2SbSize ][ n ][ 0 ]    yC = ( yS <<log2SbSize ) − DiagScanOrder[ log2SbSize ][ log2SbSize ][ n ][ 1 ]   if( abs_level_gt3_flag[ n ] )     abs_remainder[ n ] ae(v)   AbsLevelf xC ][ yC ] − AbsLevelPass1[ xC ][ yC ]+ 2 * (abs_level_gt3_flag[ n ] + abs_remainder[ n ] )   }   for( n =firstPosMode1; n > firstPosMode2; n− − ) {    xC − ( xS << log2SbSize )− DiagScanOrder[ log2SbSize ][ log2SbSize ][ n ][ 0 ]    yC = ( yS <<log2SbSize ) − DiagScanOrder[ log2SbSize ][ log2SbSize ][ n ][ 1 ]

TABLE 58  if( abs_level_gt1_flag[ n ] )   abs_remainder[ n ] ae(v) AbsLevel[ xC ][ yC ] − AbsLevelPass1[ xC ][ yC ] + 2 * abs remainder[ n] } for( n = firstPosMode2; n >= 0; n− − ) {  xC = ( xS << log2SbSize) + DiagScanOrder + log2SbSize ][ log2SbSize ][ n ][ 0 ]  yC = ( yS <<log2SbSize ) + DiagScanOrder + log2SbSize ][ log2SbSize ][ n ][ 1 ] dec_abs_level[ n ] ae(v)  if(AbsLevel[ xC ][ yC ] > 0 )  firstSigScanPosSb − n  if( dep_quant_enabled_flap )   QState =QStateTransTable[ QState ][ AbsLevel[ xC ][ yC ] & 1 ] } if(dep_quant_enabled_flag | | !sign_data_hiding_enabled_flag )  signHidden= 0 else  signHidden − ( lastSigScanPosSb − firstSigScanPosSb >3 ? 1 : 0 ) for( n − numSbCoeff − 1; n >− 0; n− − ) {  xC = ( xS <<log2SbSize ) + DiagScanOrder[ log2SbSize ][ log2SbSize ][ n ][ 0 ]  yC =( yS << log2SbSize ) + DiagScanOrder[ log2SbSize ][ log2SbSize ][ n ][ 1]  if( sig_coeff_flag[ xC ][ yC ] &&   ( !signHidden | | (n != firstSigScanPosSb ) ) )   coeff_sign_flag[ n ] ae(v) } if( depquant enabled flag ) {  QState = startQStateSb  for( n = numSbCoeff );n >= 0; n  ) {   xC = ( xS << log2SbSize ) +    DiagScanOrder[log2SbSize ][ log2SbSize ][ n ][ 0 ]   yC = ( yS << log2SbSize ) +   DiagScanOrder[ log2SbSize ][ log2SbSize ][ n ][ 1 ]  if(_sig_coeff_flag[ xC ][ yC ] )    TransCoeffLevel[ x0 ][ y0 ][ cIdx][ xC ][ yC ] =     ( 2 * AbsLevel[ xC ][ yC ] − ( QState > 1 ? 1 : 0 ))*     ( 1 − 2 * coeff_sign_flag[ n ] )    QState = QStateTransTable[QState ][ par_level_flag[ n ] ]  } else {   sumAbsLevel = 0   for( n =numSbCoeff − 1; n >= 0; n− − ) {    xC = ( xS << log2SbSize ) +    DiagScanOrder[ log2SbSize ][ log2SbSize ][ n ][ 0 ]    yC = ( yS <<log2SbSize ) +     DiagScanOrder[ log2SbSize ][ log2SbSize ][ n ][ 1 ]   if( sig_coeff_flag[ xC ][ yC ] ) {     TransCoeffLevel[ x0 ][ y0 ][cIdx ][ xC ][ yC ] =      AbsLevel[ xC ][ yC ] * ( 1 − 2 *coeff_sign_flag[ n ] )    if( signHidden ) {    sumAbsLevel += AbsLevel[ xC ][ yC ]     if( ( n == firstSigScanPosSb ) && ( sumAbsLevel % 2 ) = = 1 ) )

TABLE 59        TransCoeffLevel[ x0 ][ y0 ][ cIdx ][ xC ][ yC ] =         −TransCoeffLevel[ x0 ][ y0 ][ cIdx ][ xC ][ yC ]      }     }   }   }  } }

For example, as illustrated in Tables 6 to 9 or Tables 56 to 59described above, the information represented by the syntax elementsincluded in the residual coding syntax or semantics of the syntaxelements may be represented as described above with Tables 6 to 9.

Meanwhile, for example, an embodiment of the present document mayperform a scaling or transform procedure based on at least some of theaforementioned syntax or syntax elements. For example, an embodiment mayderive the residual samples (or residual sample array) for the samplesof the current (transform) block, as illustrated in Table 60.

TABLE 60 Scaling and transformation process Inputs to this processare: - a luma location ( xTbY, yTbY ) specifying the top-left sample ofthe current luma transform block relative to the top-left luma sample ofthe current picture. - a variable cIdx specifying the colour componentof the current block, - a variable nTbW specifying the transform blockwidth, - a variable nTbH specifying the transform block height. Outputof this process is the (nTbW)x(nTbH) array of residual samplesresSamples[ x ][ y ] with x − 0..nTbW − 1. y = 0..nTbH − 1. Thevariables bitDepth, bdShift and tsShift are derived as follows: bitDepth = ( cIdx = = 0 ) ? BitDepth_(Y) : BitDepth_(C)  bdShift = Max(20 − bitDepth, 0 )  tsShift = 5 + ( ( Log2( nTbW ) + Log2( nTbH ) ) / 2)The (nTbW)x(nTbH) array of residual samples resSamples is derived asfollows: 1. The scaling process for transform coefficients as specifiedin clause 8.5.3 is invoked with the transform block location ( xTbY,yTbY ), the transform block width nTbW and the transform block heightnTbH, the colour component variable cIdx and the bit depth of thecurrent colour component bitDepth as inputs, and the output is an(nTbW)x(nTbH) array of scaled transform coefficients d. 2. The(nTbW)x(nTbH) array of residual samples r is derived as follows: - IfIsTrafoSkip is equal to 1 and cIdx is equal to 0, the residual samplearray values r[ x ][ y ]with x = 0..nTbW − 1, y = 0..nTbH − 1 arederived as follows:  r[ x ][ y ] = d[ x ][ y ] << tsShift - Otherwise(IsTrafoSkip is equal to 0 or cIdx is not equal to 0), thetransformation process for scaled transform coefficients as specified inclause 8.5.4.1 is invoked with the transform block location ( xTbY, yTbY), the transform block width nTbW and the transform block height nTbH,the colour component variable cIdx and the (nTbW)x(nTbH) array of scaledtransform coefficients d as inputs, and the output is an (nTbW)x(nTbH)array of residual samples r. 3. The residual samples resSamples[ x ][ y]with x = 0..nTbW − 1, y = 0..nTbH − 1 are derived as follows: resSamples[ x ][ y ] = ( r[ x ][ y ] + ( 1 << ( bdShift − 1 ) )) >> bdShift

Meanwhile, alternatively, for example, an embodiment of the presentdocument may perform the transform procedure for the transformcoefficient based on at least some of the aforementioned syntax orsyntax elements. For example, an embodiment may derive the residualsamples (or residual sample array) based on the information about the(scaled) transform coefficients as illustrated in Table 61.

TABLE 61 Transformation process for scaled transform coefficients8.5.4.1 General Inputs to this process are - a luma location ( xTbY,yTbY ) specifying the top-left sample of the current luma transformblock relative to the top-left luma sample of the current picture. avariable nTbW specifying the width of the current transform block. - avariable nTbH specifying the height of the current transform block. - avariable cIdx specifying the colour component of the current block, an(nTbW)x(nTbH) array d[ x ][ y ] of scaled transform coefficients with x− 0..nTbW − 1, y − 0..nTbH − 1. Output of this process is the(nThW)x(nTbH) array r[ x ][ y ] of residual samples with x = 0..nTbW −1, y = 0..nTbH 1. The variables nonZeroW and nonZeroH are derived asfollows:  nonZeroW = Min( nTbW, 32 )  nonZeroH = Min( nTbH, 32 ) The(nTbW)x(nTbH) array r of residual samples is derived as follows: 4. Each(vertical) column of scaled transform coefficients d[ x ][ y ]with x =0..nonZeroW − 1, y = 0..nonZeroH − 1 is transformed to c[ x ][ y ] withx = 0..nonZeroW − 1, y = 0..nTbH − 1 by invoking the one-dimensionaltransformation process as specified in clause 8.5.4.2 for each column x= 0..nonZeroW − 1 with the height of the transform block nTbH, thenon-zero height of the scaled transform coefficients nonZeroH, the listd[ x ][ y ]with y = 0..nonZeroH − 1 and the transform type variabletrType set equal to TrVerType as inputs, and the output is the list c[ x][ y ] with y = 0..nTbH − 1. 5. The intermediate sample values g[ x ][ y]with x = 0..nonZeroW − 1, y =0..nTbH − 1 are derived as follows:  g[ x][ y ] = Clip3( CoeffMin, CoeffMax, ( e[ x ][ y ] + 64 >> 7) 6. Each(horizontal) row of the resulting array g[ x ][ y ] with x = 0..nonZeroW− 1, y = 0..nTbH − 1 is transformed to r[ x ][ y ] with x = 0..nTbW − 1,y = 0..nThH − 1 by invoking the one-dimensional transformation processas specified in clause 8.5.4.2 for each row y = 0..nTbH 1 with the widthof the transform block nTbW, the non-zero width of the resulting arrayg[ x ][ y ] nonZeroW, the list g[ x ][ y ]with x = 0..nonZeroW − 1 andthe transform type variable trType set equal to TrHorType as inputs, andthe output is the list r[ x ][ y ]with x − 0..nTbW − 1.

Meanwhile, for example, in an embodiment of the present document, thebinarization as illustrated in Tables 62 and 63 may be used for at leastsome of the aforementioned syntax or syntax elements. Alternatively, anembodiment may encode/decode at least some of the aforementioned syntaxelements by using the binarization as illustrated in Tables 62 and 63.

TABLE 62 Binarization Syntax structure Syntax element Process Inputparameters tile_group_data( ) end_of_tile_group_flag FL cMax = 1coding_tree_unit( ) alf_ctb_flag[ ][ ][ ] FL cMax − 1 sao( )sao_merge_left_flag FL cMax − 1 sao_merge_up_flag FL cMax − 1sao_type_idx_luma TR cMax

 2, cRiceParam − 0 sao_type_idx_chroma TR cMax − 2, cRiceParam − 0sao_offset_abs[ ][ ][ ][ ] TR cMax = (1 << ( Min( bitDepth, 10) − 5 ) )− 1, cRiceParain = 0 sao_offset_sign[ ][ ][ ][ ] FL cMax = 1sao_band_position[ ][ ][ ] FL cMax

 31 sao_

o_class_luma FL cMax

 3 sao_

o_class_chroma FL cMax = 3 coding_quadtree( ) qt_split_cu_flag[ ][ ] FLcMax − 1 multi_type_tree( ) mtt_split_cu_flag FL cMax = 1mtt_split_cu_vertical_flag FL cMax − 1 mtt_split_cu_binary_flag FL cMax= 1 coding_unit( ) cu_skip_flag[ ][ ] FL cMax − 1 pred_mode_flag FL cMax= 1 pcm_flag[ ][ ] FL cMax = 1 intra_luma_ref_idx[ ][ ] TR cMax = 2,cRiceParam

 0 intra_luma_mpm_flag[ ][ ] FL cMax = 1 intra_luma_mpm_idx[ ][ ] TRcMax = 5, cRiceParam − 0 intra_luma_mpm_remainder[ ][ ] TR cMax − 60intra_chroma_pred_mode[ ][ ] 9.5.3.7

merge_flag[ ][ ] FL cMax − 1 inter_pred_idc[ x0 ][ y0 ] 9.5.3.8 cbWidth,cbHeight inter_affine_flag[ ][ ] FL cMax = 1 cu_affine_type_flag[ ][ ]FL cMax = 1 ref_idx _l0[ ][ ] TR cMax = num_ref_idx_l0_active_minus1,cRiceParam = 0 mvp_l1_flag[ ][ ] FL cMax − 1 ref_idx_l1[ ][ ] TR cMax −num_ref_idx_l1_active_minus1, cRiceParam − 0 mvp_l1_flag[ ][ ] FL cMax −1 avmr_flag[ ][ ] FL cMax − 1 amvr_4pel_flag[ ][ ] FL cMax − 1 gbi_idx[][ ] TR cMax − NoBackwardPredFlag ? 4: 2 cu_cbf FL cMax = 1

indicates data missing or illegible when filed

TABLE 63 Binarization Syntax structure Syntax element Process Inputparameters merge_data( ) mmvd_flag[ ][ ] FL cMax − 1 mmvd_merge_flag[ ][] FL cMax = 1 nmvd_distance_idx[ ][ ] TR cMax = 7, cRiceParam = 0mmvd_direction_idx[ ][ ] FL cMax

 3 ciip_flag[ ][ ] FL cMax − 1 ciip_luma_mpm_flag[ ][ ] FL cMax − 1ciip_luma_mpm_idx[ ][ ] TR cMax = 2, cRiceParam = 0 merge_subblock_flag[][ ] FL cMax − 1 merge_subblock_idx[ ][ ] TR cMax =MaxNumSubblockMergeCand − 1, cRiceParam = 0 merge_triangle_flag[ ][ ] FLcMax = 1 merge_triangle_idx[ ][ ] EG1 — merge_idx[ ][ ] TR cMax =MaxNumMergeCand 1, cRiceParam = 0 mvd_coding( ) abs_mvd_greater0, flag[] FL cMax − 1 abs_mvd_greater1_flag[ ] FL cMax = I abs_mvd_minus2[ ] EG1— mvd_sgn_flag[ ] FL cMax − 1 transform_unit( ) tu_cbf_luma[ ][ ][ ] FLcMax − 1 tu_cbf_cb[ ][ ][ ] FL cMax = 1 tu_cbf_cr[ ][ ][ ] FL cMax − 1cu_qp_delta_abs 9.5.3.9 — cu_qp_delta_sign_flag FL cMax − 1 tu_mts_idx[][ ] TR cMax − MaxMtsIdx, cRiceParam − 0 residual_coding( )last_sig_coeff_x_prefix TR cMax − ( log2TbWidth << 1 ) 1, cRiceParam − 0last_sig_coeff_y_prefix TR cMax = ( log2TbHeight << 1 ) − 1, cRiceParam= 0 last_sig_coeff_x_suffix FL cMax = ( 1 << ( (last_sig_coeff_x_prefix >> 1 ) 1) 1 ) last_sig_coeff_y_suffix FL cMax

 ( 1 << ( ( last sig_coeff_y_prefix >> 1 ) − 1 ) − 1 )coded_sub_block_flag][ ] FL cMax = 1 sig_coeff_flag[ ][ ] FL cMax − 1par_level_flag[ ] FL cMax = 1 abs_level_gt1_flag[ ] FL cMax − 1abs_level_gt3_flag[ ] FL cMax

 1 abs_remainder[ ] 9.5.3.10 cIdx, current sub-block index i, x0, y0dec_abs_level[ ] 9.5.3.11 cIdx, x0, y0, xC, yC, log2TbWidth,log2TbHeight coeff_sign_flag[ ] FL cMax − 1

indicates data missing or illegible when filed

Meanwhile, for example, an embodiment of the present document may assignthe context index increment (ctxInc) to derive (or represent) thecontext index (ctxIdx) as illustrated in Tables 64 and 65 with respectto at least some of the aforementioned syntax or syntax elements.

TABLE 64 binIdx Syntax element 0 1 2 3 4 >=5 end_of_tile_group_flagterminate na na na na na alf_ctb_flag[ ][ ][ ] 0 . . . 8 (clause9.5.4.2.2) na na na na na sao_merge_left_flag 0 na na na na nasao_merge_up_flag 0 na na na na na sao_type_idx_luma 0 bypass na na nana sao_type_idx_chroma 0 bypass na na na na sao_offset_abs[ ][ ][ ][ ]bypass bypass bypass bypass bypass na sao_offset_sign[ ][ ][ ][ ] bypassna na na na na sao_band_position[ ][ ][ ] bypass bypass bypass bypassbypass bypass sao_eo_class_luma bypass bypass na na na nasao_eo_class_chroma bypass bypass na na na na qt_split_cu_flag[ ][ ] 0 .. . 5 (clause 9.5.4.2.2) na na na na na mtt_split_cu_flag 0 . . . 12(clause 9.5.4.2.2) na na na na na mtt_split_cu_vertical_flag (CbWidth == cbHeight) na na na na na ? 0:((cbWidth > cbHeight) ? 1:2)mtt_split_cu_binary_flag 0 na na na na na cu_skip_flag[ ][ ] 0 . . . 12(clause 9.5.4.2.2) na na na na na pred_mode_flag 0 na na na na napcm_flag[ ][ ] terminate na na nu na na intra_luma_ref_idx[ ][ ] 0 1 2na na na intra_luma_mpm_flag[ ][ ] 0 na na na na na intra_luma_mpm_idx[][ ] bypass bypass bypass bypass bypass na intra_luma_mpm_remainder[ ][] bypass bypass bypass bypass bypass bypass intra_chroma_pred_mode[ ][ ]0 bypass bypass na na na sps_cclm_enabled_flag

 0 intra_chroma_pred_mode[ ][ ] sps_cclm_enabled_flag = = 1 && 0 1 2bypass bypass na bin at binIdx equal to 2 − − 0 intra_chroma_pred_mode[][ ] sps_cclm_enabled_flag = = 1 && 0 1 2 2 na na bin at binIdx equal to2 − − 1 merge_subblack_f1ag[ ][ ] 0, 1, 2 (clause 9.5.4.2.2) na na na nana merge_subblock_idx[ ][ ] 0 bypass bypass bypass bypass bypasssps_sbtmvp_enabled_flag − − 0 merge_subblock_idx[ ][ ] 0 1 2 3 4 4sps_shtmvp_enabled_flag

1 merge_flag[ ][ ] 0 na na na na na mmvd_flag[ ][ ] 0 na na na na nammvd_merge_flag[ ][ ] 0 na na na na na mmvd_distance_idx[ ][ ] 0 bypassbypass bypass bypass bypass mmvd_direction_idx[ ][ ] bypass bypass na nana na merge_triangle_flag[ ][ ] 0, 1, 2 (clause 9.5.4.2.2) na na na nana merge_triangle_idx[ ][ ] 0 bypass bypass bypass bypass bypassmerge_idx[ ][ ] 0 bypass bypass bypass bypass na ciip_flag[ ][ ] 0 na nana na na ciip_luma_mpm_flag[ ][ ] 0 na na na na na ciip_luma_mpm_idx[ ][] 0 bypass na na na na

indicates data missing or illegible when filed

TABLE 65 binIdx Syntax element 0 1 2 3 4 >=5 inter_pred_idc[ x0 ][ y0 ]( cbWidth + cbHeight ) 4 na na na na != 8 ? 7 ( ( 1 + Log2( cbWidth ) +Log2( cbHeight ) ) >> 1 ) : 4 inter_affine_flag[ ][ ] 0, 1, 2 (clause9.5.4.2.2) na na na na na cu_affine_type_flag[ ][ ] 0 na na na na naref_idx_l0[ ][ ] 0 1 bypass bypass bypass bypass ref_idx_l1[ ][ ] 0 1bypass bypass bypass bypass mvp_l0_flag[ ][ ] 0 na na na na namvp_l1_flag[ ][ ] 0 na na na na na amvr_flag[ ][ ] 0, 1, 2 (clause9.5.4.2.2) na na na na na amvr_4pel_flag[ ][ ] 0 na na na na na gbi_idx[][ ] 0 1 na na na na NoBackwardPredFlag − − 0 gbi_idx[ ][ ] 0 1 2 3 nana NoBackwardPredFlag = = 1 cu_cbf 0 na na na na naabs_mvd_greater0_flag[ ] 0 na na na na na abs_mvd_greater1_flag[ ] 0 nana na na na abs_mvd_minus2[ ] bypass bypass bypass bypass bypass bypassmvd_sign_flag[ ] bypass na na na na na tu_cbf_luma[ ][ ][ ] trDeptb = =0 ? 1 : 0 na na na na na tu_cbf_cb[ ][ ][ ] trDepth = = 0 ? 1 : 0 na nana na na tu_cbf_cr[ ][ ][ ] tu_cbf_cb[ ][ ][ ] na na na na nacu_qp_delta_abs 0 1 1 1 1 bypass cu_qp_delta_sign_flag bypass na na nana na tu_mts_idx[ ][ ] 0 na na na na na MaxMtsIdx = = 1 tu_mts_idx[ ][ ]1 . . . 6 7 8 9 na na MaxMtsIdx − − 4 (1 + cqtDepth) tu_mts_idx[ ][ ] 01 . . . 6 7 8 9 na MaxMtsIdx

 5 (1 + eqtDepth) last_sig_coeff_x_prefix 0 . . . 23 (clause 9.5.4.2.3)last_sig_coeff_y_prefix 0 . . . 23 (clause 9.5.4.2.3)last_sig_coeff_x_suffix bypass bypass bypass bypass bypass bypasslast_sig_coeff_y_suffix bypass bypass bypass bypass bypass bypasscoded_sub_block_flag[ ][ ] 0 . . . 3 (clause 9.5.4.2.4) na na na na nasig_coeff_flag[ ][ ] 0 . . . 89 (clause 9.5.4.2.6) na na na na napar_level_flag[ ] 0 . . . 32 (clause 9.5.4.2.7) na na na na naabs_level_gt1_flag[ ] 0 . . . 32 (clause 9.5.4.2.7) na na na na naabs_level_gt3_flag[ ] 0 . . . 32 (clause 9.5.4.2.7) na na na na naabs_remainder[ ] bypass bypass bypass bypass bypass bypassdec_abs_level[ ] bypass bypass bypass bypass bypass bypasscoeff_sign_flag[ ] bypass na na na na na

indicates data missing or illegible when filed

FIGS. 13 and 14 schematically illustrate an example of a video/imageencoding method and related components according to an embodiment (s) ofthe present document.

The method disclosed in FIG. 13 may be performed by the encodingapparatus disclosed in FIG. 2 . Specifically, for example, S1300illustrated in FIG. 13 may be performed by the predictor 220 of theencoding apparatus in FIG. 14 , S1310 illustrated in FIG. 13 may beperformed by the residual processor 230 of the encoding apparatus inFIGS. 14 , and S1320 illustrated in FIG. 13 may be performed by theentropy encoder 240 of the encoding apparatus in FIG. 14 . The methoddisclosed in FIG. 13 may include the aforementioned embodiments in thepresent document.

Referring to FIG. 13 , the encoding apparatus may derive predictionsamples by performing prediction on the current block (S1300). Forexample, the encoding apparatus may derive the prediction samples byperforming the prediction on the current block, and may deriveinformation about a prediction mode which performs the prediction. Forexample, the prediction mode may be an intra prediction mode or an interprediction mode. For example, when the prediction mode is the intraprediction mode, the encoding apparatus may derive the predictionsamples based on samples around the current block. Alternatively, whenthe prediction mode is the inter prediction mode, the encoding apparatusmay derive the prediction samples based on reference samples within areference picture of the current block.

The encoding apparatus may derive residual samples for the current block(S1310). For example, the encoding apparatus may derive the residualsamples (or residual blocks) for the current block based on the originalsamples and the prediction samples (or predicted blocks) for the currentblock. Here, the residual samples may also be represented by a residualsample array. Alternatively, for example, although not illustrated inFIG. 13 , the encoding apparatus may generate reconstruction samples ofthe current block based on the prediction samples and the residualsamples. For example, the encoding apparatus may also generate thereconstruction samples (or reconstructed blocks) by adding the residualsamples (or residual blocks) to the prediction samples (or predictedblocks).

The encoding apparatus may encode image information including predictionmode information about the prediction and residual related informationabout the residual samples (S1320).

For example, the encoding apparatus may generate prediction modeinformation based on the prediction mode, and the image information mayinclude the prediction mode information. That is, when the current blockperforms the prediction through the intra prediction mode, theprediction mode information may include the information about the intraprediction mode, and when the current block performs the predictionthrough the inter prediction mode, the prediction mode information mayinclude the information about the inter prediction mode.

For example, the encoding apparatus may generate the residual relatedinformation including the information about the residual samples (orresidual sample array), and the image information may include theresidual related information. The information related to the residualsamples or the residual related information may include the informationabout the transform coefficients related to the residual samples.

For example, the residual related information may include residualcoding information (or residual coding syntax). Alternatively, theresidual related information may include transform unit information (ortransform unit syntax). Alternatively, the residual related informationmay also include the residual coding information and the transform unitinformation.

For example, the residual related information may include the transformskip flag based on a size of the current block and a maximum transformskip size. Alternatively, whether the residual related informationincludes the transform skip flag may be determined based on the size ofthe current block and the maximum transform skip size. For example, thetransform skip flag may represent whether the transform skip is appliedto the current block. Alternatively, the transform skip flag may also berepresented by the transform_skip_flag syntax element. For example, whenthe value of the transform_skip_flag syntax element is 0, the transformskip may be applied to the current block, and when the value of thetransform_skip_flag syntax element is 1, the transform skip may not beapplied to the current block. Alternatively, according to the setting,when the value of the transform_skip_flag syntax element is 1, thetransform skip may be applied to the current block, and when the valueof the transform_skip_flag syntax element is 0, the transform skip maynot be applied to the current block.

For example, the size of the current block may represent the width ofthe current block and/or the height of the current block. The maximumtransform skip size may represent the maximum size of the block in whichthe Transform Skip (TS) is enabled. Alternatively, the maximum transformskip size may also be represented by MaxTs Size. For example, when thewidth of the current block or the height of the current block is smallerthan or equal to the maximum transform skip size, the residual relatedinformation may include the transform skip flag.

For example, the image information may include information about themaximum transform skip size. Alternatively, the information about themaximum transform skip size may be (entropy) encoded by being includedin the image information. For example, the maximum transform size may berepresented based on the information about the maximum transform skipsize. For example, the information about the maximum transform skip sizemay be included in the high level syntax, and the high level syntax maybe (entropy) encoded by being included in the image information. Forexample, the high level syntax may be a Network Abstraction Layer (NAL)unit syntax, a Sequence Parameter Set (SPS) syntax, a Picture ParameterSet (PPS) syntax, or a slice header syntax.

Alternatively, for example, the information about the maximum transformskip size may be included in the SPS, and the maximum transform size maybe represented based on the information about the maximum transform skipsize included in the SPS. Alternatively, for example, the informationabout the maximum transform skip size may be included in the PPS, andthe maximum transform size may be represented based on the informationabout the maximum transform skip size included in the PPS. Here, the SPSor the PPS may represent the SPS syntax or the PPS syntax, and othersyntaxes may also be used by omitting the term syntax.

For example, the information about the maximum transform skip size mayinclude information about a value obtained by adding −2 to a log value,and the log value may be a log value having a base 2 for the maximumtransform skip size. That is, the information about the maximumtransform skip size may represent information about a value obtained byadding −2 to the log value having the base 2 of the maximum transformskip size. Alternatively, for example, the information about the maximumtransform skip size may also include the information about the log value(having the base 2) of the maximum transform skip size.

For example, the information about the maximum transform skip size mayinclude a log 2_transform_skip_max_size_minus2 syntax element.Alternatively, the information about the maximum transform skip size mayrepresent the log 2_transform_skip_max_size_minus2 syntax element. Forexample, the log 2_transform_skip_max_size_minus2 syntax element may beincluded in the high level syntax, the SPS syntax, or the PPS syntax.

For example, referring to Table 41, the maximum transform skip size maybe represented based on MaxTsSize=1<<(log2_transform_skip_max_size_minus2+2). Here, the MaxTsSize may representthe maximum transform skip size, and the log2_transform_skip_max_size_minus2 may represent the value of the log2_transform_skip_max_size_minus2 syntax element. In addition, the << mayrepresent an arithmetic shift operator. That is, the log2_transform_skip_max_size_minus2 syntax element may represent theMaxTsSize by using the MaxTsSize=1<<(log2_transform_skip_max_size_minus2+2). Alternatively, the log2_transform_skip_max_size_minus2 syntax element may represent the valueof the log 2_transform_skip_max_size_minus2 syntax element according tothe MaxTsSize. Alternatively, the log 2_transform_skip_max_size_minus2syntax element may represent the value of the log2_transform_skip_max_size_minus2 syntax element corresponding to theMaxTsSize. For example, the value of the log2_transform_skip_max_size_minus2 syntax element may be represented byone of the candidate values of 0 to 3, but is not limited thereto.Alternatively, the value of the log 2_transform_skip_max_size_minus2syntax element may be represented by 0, 1, 2, or 3, but is not limitedthereto.

In addition, for example, the maximum transform skip size may berepresented by one of candidate sizes including 4, 8, 16, or 32. Themaximum transform skip size may be represented based on the value of thelog 2_transform_skip_max_size_minus2 syntax element. Alternatively, themaximum transform skip size may be represented by one of candidate sizesincluding 4, 8, 16, or 32 based on the value of the log2_transform_skip_max_size_minus2 syntax element. For example, when thevalue of the log 2_transform_skip_max_size_minus2 syntax element is 0,the maximum transform skip size may be represented by 4 based on theaforementioned 1<<(log 2_transform_skip_max_size_minus2+2).Alternatively, when the value of the log2_transform_skip_max_size_minus2 syntax element is 1, the maximumtransform skip size may be represented by 8 based on the aforementioned1<<(log 2_transform_skip_max_size_minus2+2). Alternatively, when thevalue of the log 2_transform_skip_max_size_minus2 syntax element is 2,the maximum transform skip size may be represented by 16 based on theaforementioned 1<<(log 2_transform_skip_max_size_minus2+2).Alternatively, when the value of the log2_transform_skip_max_size_minus2 syntax element is 3, the maximumtransform skip size may be represented by 32 based on the aforementioned1<<(log 2_transform_skip_max_size_minus2+2).

For example, the fact that the maximum transform skip size is N mayrepresent that all of the width and the height have the sizes which aresmaller than or equal to N. Alternatively, the fact that the maximumtransform skip size is N may represent that a larger value of the widthand the height has the size which is smaller than or equal to N.Alternatively, the fact that the maximum transform skip size is N mayrepresent that a length of one side has the size which is smaller thanor equal to N in the case of a square block.

Alternatively, for example, the information about the maximum transformskip size may also be included in the high level syntax, the SPS syntax,or the PPS syntax based on the information about whether the transformskip is enabled. For example, when the information about whether thetransform skip is enabled represents the information that the transformskip is enabled, the information about the maximum transform skip sizemay be included in the high level syntax, the SPS syntax, or the PPSsyntax. Alternatively, when the information about whether the transformskip is enabled represents information that the transform skip is notenabled, the information about the maximum transform skip size may notbe included in the high level syntax, the SPS syntax, or the PPS syntaxeither.

Alternatively, for example, the maximum transform skip size may also berepresented based on the information about whether the MultipleTransform Selection (MTS) is enabled. Alternatively, the maximumtransform skip size may be represented based on the information aboutwhether the MTS is enabled and whether the TS is enabled.

For example, the high level syntax may include the information aboutwhether the Multiple Transform Selection (MTS) is enabled or theinformation about whether the TS is enabled. Alternatively, theinformation about whether the MTS is enabled or the information aboutwhether the TS is enabled may be included in the SPS syntax or the PPSsyntax.

For example, the information about whether the MTS is enabled may berepresented by the sps_mts_enabled_flag syntax element. Alternatively,the information about whether the MTS is enabled may include thesps_mts_intra_enabled_flag syntax element or thesps_mts_inter_enabled_flag syntax element. For example, thesps_mts_intra_enabled_flag syntax element or thesps_mts_inter_enabled_flag syntax element may be included in the SPSsyntax based on the sps_mts_enabled_flag syntax element. Thesps_mts_intra_enabled_flag syntax element may be represented by thesps_explicit_mts_intra_enabled_flag syntax element, and thesps_mts_inter_enabled_flag syntax element may be represented by thesps_explicit_mts_inter_enabled_flag syntax element. For example, theinformation about whether the MTS is enabled may also be represented bythe MTS enabled information.

For example, when the information about whether the MTS is enabledrepresents information that the MTS is enabled, it may be representedthat the MTS enabled=1 or the value of the sps_mts_enabled_flag syntaxelement is 1. Alternatively, it may be represented that the value of thesps_mts_enabled_flag syntax element is 1, and the value of thesps_explicit_mts_intra_enabled_flag syntax element orsps_explicit_mts_inter_enabled_flag syntax element is 1. Alternatively,when the information about whether the MTS is enabled representsinformation that the MTS is not enabled, it may be represented that theMTS enabled=0 or the value of the sps_mts_enabled_flag syntax element is0. Alternatively, it may be represented that the value of thesps_mts_enabled_flag syntax element is 1, and the value of thesps_explicit_mts_intra_enabled_flag syntax element or thesps_explicit_mts_inter_enabled_flag syntax element is 0. For example,according to the setting, the value may also represent the informationcorresponding to the value inversely.

For example, the information about whether the TS is enabled may berepresented by the TS enabled information or thesps_transform_skip_enabled_flag syntax element. For example, theinformation about whether the TS is enabled may also be represented bythe TS enabled information.

For example, when the information about whether the TS is enabledrepresents information that the TS is enabled, it may be representedthat the TS enabled=1 or the value of thesps_transform_skip_enabled_flag syntax element is 1. Alternatively, whenthe information about whether the TS is enabled represents informationthat the TS is not enabled, it may be represented that TS enabled=0 orthe value of the sps_transform_skip_enabled_flag syntax element is 0.For example, according to the setting, the value may represent theinformation corresponding to the value inversely.

For example, the maximum transform skip size may be represented by oneof candidate sizes including 8, 16, and 32 based on the high levelsyntax. For example, the candidate sizes may further include 4.Alternatively, for example, the transform skip size may be derived basedon the information about whether the MTS is enabled. Alternatively, forexample, the maximum transform skip size may be represented by one ofcandidate sizes including 8, 16, or 32 based on the information aboutwhether the MTS is enabled. Alternatively, the transform skip size maybe represented based on the information about whether the MTS includedin the high level syntax is enabled. Alternatively, for example, theinformation about the transform skip size may be included in the highlevel syntax, and the transform skip size may be represented based onthe information about the transform skip size. Here, the informationabout the transform skip size may also include the information aboutwhether the MTS is enabled as the information capable of deriving thetransform skip size.

For example, based on the information about whether the MTS is enabled,which represents the information that the MTS is enabled, the maximumtransform skip size may be determined based on the size of the MTS. Thatis, when the information about whether the MTS is enabled represents theinformation that the MTS is enabled, the maximum transform skip size maybe determined based on the size of the MTS. That is, the maximumtransform skip size may be dependent on the MTS. The size of the MTS mayrepresent the maximum size of the block in which the MTS is enabled. Forexample, when the size of the MTS is 32 or less, the transform skip mayalso be enabled for the block having the size of 32 or less.

Alternatively, for example, based on the information about whether theMTS is enabled, which represents the information that the MTS isenabled, the maximum transform skip size may be determined as a presetsize. That is, when the information about whether the MTS is enabledrepresents the information that the MTS is enabled, the maximumtransform skip size may be determined as the preset size. For example,when the preset size is 8, the maximum transform skip size may bedetermined as the preset size, 8.

Alternatively, for example, based on the information about whether theMTS is enabled, which represents the information that the MTS isenabled, the high level syntax may include the information about themaximum transform skip size, and the maximum transform skip size may berepresented based on the information about the maximum transform skipsize. That is, when the information about whether the MTS is enabledrepresents the information that the MTS is enabled, the high levelsyntax may separately include the information about the maximumtransform skip size, and the maximum transform skip size may berepresented based on the information about the maximum transform skipsize. Alternatively, for example, when the information about whether theMTS is enabled represents the information that the MTS is enabled, thehigh level syntax may include the information about whether the maximumtransform skip size is represented based on the size of the MTS. Whenthe information about whether the maximum transform skip size isrepresented based on the size of the MTS represents the information thatthe maximum transform skip size is represented based on the size of theMTS, the high level syntax may include the information about the maximumtransform skip size. The information about the maximum transform skipsize may be included in the SPS syntax or the PPS syntax. For example,when the information about the maximum transform skip size included inthe high level syntax represents the information about 32, the maximumtransform skip size may be represented by 32 based on the informationabout the maximum transform skip size. Alternatively, when the maximumtransform skip size is determined as 32, the information about themaximum transform skip size included in the high level syntax may berepresented by the information about 32.

Alternatively, for example, based on the information about whether theMTS is enabled, which represents the information that the MTS is notenabled, the maximum transform skip size may be determined as the presetsize. That is, when the information about whether the MTS is enabledrepresents the information that the MTS is not enabled, the maximumtransform skip size may be determined as the preset size. For example,when the preset size is 8, the maximum transform skip size may bedetermined as the preset size, 8.

Alternatively, for example, based on the information about whether theMTS is enabled, which represents the information that the MTS is notenabled, the high level syntax may include the information about themaximum transform skip size, and the maximum transform skip size may berepresented based on the information about the maximum transform skipsize. That is, when the information about whether the MTS is enabledrepresents the information that the MTS is not enabled, the high levelsyntax may separately include the information about the maximumtransform skip size, and the maximum transform skip size may berepresented based on the information about the maximum transform skipsize. The information about the maximum transform skip size may beincluded in the SPS syntax or the PPS syntax. For example, when theinformation about the maximum transform skip size included in the highlevel syntax represents the information about 32, the maximum transformskip size may be represented by 32 based on the information about themaximum transform skip size. Alternatively, when the maximum transformskip size is determined as 32, the information about the maximumtransform skip size included in the high level syntax may be representedby the information about 32.

For example, the residual related information may include the MTS indexinformation about the transform type applied to the current block. Forexample, the MTS index information may be represented by the tu_mts_idxsyntax element or the mts_idx syntax element. For example, the MTS indexinformation may be included in the transform unit syntax or the codingunit syntax. For example, the MTS index information may represent theinformation about the transform type or the transform skip applied tothe current block. Alternatively, the MTS index information mayrepresent the information about the transform type or the transform skipapplied to the current block based on the information about whether theMTS is enabled and/or the information about whether the transform skipis enabled.

For example, the information represented by the MTS index informationmay be represented based on the bin of the bin string on the MTS indexinformation. Alternatively, the information represented by the MTS indexinformation may be represented based on the value of the context indexof the bin. Alternatively, the information represented by the MTS indexinformation may be represented based on the context index value of thefirst bin of the bin string. For example, the context index (ctxIdx) maybe represented based on the context index increment (ctxInc) and thecontext index offset (ctxIdxOffset).

For example, the value of the context index of the first bin for the MTSindex information may be represented based on the information aboutwhether the MTS is enabled, the information about whether the transformskip is enabled, and the size of the current block. For example, thevalue of the context index of the first bin for the MTS indexinformation may be represented based on Table 19 or Table 22.

For example, based on the information about whether the MTS is enabled,which represents the information that the MTS is enabled and theinformation about whether the transform skip is enabled, whichrepresents that the transform skip is enabled, the value of the contextindex may be represented by comparing the width of the current blockwith the height of the current block. That is, when the informationabout whether the MTS is enabled represents the information that the MTSis enabled, and the information about whether the TS is enabledrepresents the information that the TS is enabled, the value of thecontext index may be represented by comparing the width of the currentblock with the height of the current block. Alternatively, when thewidth of the current block and the height of the current block are thesame, the value of the context index may be represented by 0.Alternatively, when the width of the current block is greater than theheight of the current block, the value of the context index may berepresented by 1, and when the width of the current block is smallerthan the height of the current block, the value of the context index maybe represented by 2.

Alternatively, for example, based on the information about whether theMTS is enabled, which represents the information that the MTS isenabled, and the coded quad-tree depth (cqtDepth), the value of thecontext index may be represented. That is, when the information aboutwhether the MTS is enabled represents the information that the MTS isenabled, the value of the context index may be represented based on thecqtDepth. For example, the value of the context index may be representedby a value obtained by adding 1 to the value of the cqtDepth, and may berepresented by 1, 2, 3, 4, 5, or 6.

Alternatively, for example, based on the information about whether thetransform skip is enabled, which represents the information that thetransform skip is enabled, the value of the context index may berepresented by comparing the width of the current block with the heightof the current block. That is, when the information about whether the TSis enabled represents the information that the TS is enabled, the valueof the context index may be represented by comparing the width of thecurrent block with the height of the current block. Alternatively, whenthe width of the current block and the height of the current block arethe same, the value of the context index may be represented by 0.Alternatively, when the width of the current block is greater than theheight of the current block, the value of the context index may berepresented by 1, and when the width of the current block is smallerthan the height of the current block, the value of the context index maybe represented by 2.

Alternatively, for example, the value of the context index may representthe ctxInc and/or the ctxIdx based on at least one of the block size,the ratio of the width-to-height of the block, whether to perform theintra or inter prediction of the block, whether to apply the transformskip to the neighbor, or the like. Alternatively, a context model basedon at least one of the block size, the ratio of the width-to-height ofthe block, whether to perform the intra or inter prediction of theblock, whether to apply the transform skip to the neighbor, or the likemay be defined, and the value of the context index may be representedbased on the context model. For example, the information about thetransform type or the transform skip for the current block may beobtained based on the context index or the context model.

For example, the residual related information may or may not include thetransform skip flag as described above. For example, when the residualrelated information includes the transform skip flag, the residualsamples of the current block may represent ones which are derivedwithout the transform, and the residual signal (or residual relatedinformation) for the current block may be signaled on the pixel domain(spatial domain) without the transform. Alternatively, when the residualrelated information does not include the transform skip flag, theresidual samples of the current block may represent ones which aretransformed and derived, and the residual signal (or residual relatedinformation) for the current block may be transformed and signaled onthe transform domain.

The encoding apparatus may generate a bitstream by encoding imageinformation including all or some of the aforementioned information (orsyntax elements). Alternatively, the encoding apparatus may output theencoded information in the form of the bitstream. In addition, thebitstream may be transmitted to the decoding apparatus through a networkor a storage medium. Alternatively, the bitstream may be stored on acomputer readable storage medium. For example, the bitstream may also berepresented by image information or video information.

FIGS. 15 and 16 schematically illustrate an example of a video/imagedecoding method and related components according to an embodiment (s) ofthe present document.

FIGS. 15 and 16 schematically illustrate an example of a video/imagedecoding method and related components according to an embodiment (s) ofthe present document. The method disclosed in FIG. 15 may be performedby the decoding apparatus disclosed in FIG. 3 . Specifically, forexample, S1500 illustrated in FIG. 15 may be performed by the entropydecoder 310 of the decoding apparatus in FIG. 16 , S1510 illustrated inFIG. may be performed by the predictor 330 of the decoding apparatus inFIG. 16 , S1520 illustrated in FIG. 15 may be performed by the residualprocessor 320 of the decoding apparatus in FIGS. 16 , and S1530illustrated in FIG. 15 may be performed by the adder 340 of the decodingapparatus in FIG. 16 . The method disclosed in FIG. 15 may include theaforementioned embodiments in the present document.

Referring to FIG. 15 , the decoding apparatus may obtain prediction modeinformation and residual related information from the bitstream (S1500).Alternatively, the decoding apparatus may obtain the prediction modeinformation or the residual related information by (entropy) decodingthe bitstream.

For example, the prediction mode information may include informationabout the prediction mode of the current block. Alternatively, theprediction mode information may include information about the intraprediction mode or the inter prediction mode.

For example, the residual related information may include residualcoding information (or residual coding syntax). Alternatively, theresidual related information may include transform unit information (ortransform unit syntax). Alternatively, the residual related informationmay also include the residual coding information and the transform unitinformation.

For example, the residual related information may include the transformskip flag based on the size of the current block and the maximumtransform skip size. Alternatively, whether the residual relatedinformation includes a transform skip flag may be determined based onthe size of the current block and the maximum transform skip size. Forexample, the transform skip flag may represent whether the transformskip is applied to the current block. Alternatively, the transform skipflag may be represented by a transform_skip_flag syntax element. Forexample, when the value of the transform_skip_flag syntax element is 0,the transform skip may be applied to the current block, and when thevalue of the transform_skip_flag syntax element is 1, the transform skipmay not be applied to the current block. Alternatively, according to thesetting, when the value of the transform_skip_flag syntax element is 1,the transform skip may be applied to the current block, and when thevalue of the transform_skip_flag syntax element is 0, the transform skipmay not be applied to the current block.

For example, the size of the current block may represent the width ofthe current block and/or the height of the current block. The maximumtransform skip size may represent the maximum size of the block in whichthe Transform Skip (TS) is enabled. Alternatively, the maximum transformskip size may also be represented by MaxTs Size. For example, when thewidth of the current block or the height of the current block is smallerthan or equal to the maximum transform skip size, the residual relatedinformation may include the transform skip flag.

For example, the information about the maximum transform skip size maybe obtained from the bitstream. Alternatively, the information about themaximum transform skip size may be obtained by (entropy) decoding thebitstream. For example, the maximum transform size may be derived basedon the information about the maximum transform skip size. For example,the information about the maximum transform skip size may be included inthe high level syntax, and the high level syntax may be obtained fromthe bitstream. Alternatively, the high level syntax may be obtained by(entropy) decoding the bitstream. For example, the high level syntax maybe a Network Abstraction Layer (NAL) unit syntax, a Sequence ParameterSet (SPS) syntax, a Picture Parameter Set (PPS) syntax, or a sliceheader syntax.

Alternatively, for example, the information about the maximum transformskip size may be included in the SPS, and the maximum transform size maybe derived based on the information about the maximum transform skipsize included in the SPS. Alternatively, for example, the informationabout the maximum transform skip size may be included in the PPS, andthe maximum transform size may be derived based on the information aboutthe maximum transform skip size included in the PPS. Here, the SPS orthe PPS may represent the SPS syntax or the PPS syntax, and othersyntaxes may also be used by omitting the term syntax.

For example, the information about the maximum transform skip size mayinclude information about a value obtained by adding −2 to a log value,and the log value may be a log value having a base 2 for the maximumtransform skip size. That is, the information about the maximumtransform skip size may represent the information about the valueobtained by adding −2 to the log value having the base 2 of the maximumtransform skip size. Alternatively, for example, the information aboutthe maximum transform skip size may also include the information aboutthe log value (having the base 2) of the maximum transform skip size.

For example, the information about the maximum transform skip size mayinclude the log 2_transform_skip_max_size_minus2 syntax element.Alternatively, the information about the maximum transform skip size mayrepresent the log 2_transform_skip_max_size_minus2 syntax element. Forexample, the log 2_transform_skip_max_size_minus2 syntax element may beincluded in the high level syntax, the SPS syntax, or the PPS syntax.

For example, referring to Table 41, the maximum transform skip size maybe derived based on MaxTs Size=1<<(log2_transform_skip_max_size_minus2+2). Here, the MaxTsSize may representthe maximum transform skip size, and the log2_transform_skip_max_size_minus2 may represent the value of the log2_transform_skip_max_size_minus2 syntax element. In addition, the << mayrepresent an arithmetic shift operator. For example, the value of thelog 2_transform_skip_max_size_minus2 syntax element may be representedby one of candidate values of 0 to 3, but is not limited thereto.Alternatively, the value of the log 2_transform_skip_max_size_minus2syntax element may be derived as 0, 1, 2, or 3, but is not limitedthereto.

In addition, for example, the maximum transform skip size may be derivedas one of candidate sizes including 4, 8, 16, or 32. The maximumtransform skip size may be derived based on the value of the log2_transform_skip_max_size_minus2 syntax element. Alternatively, themaximum transform skip size may be derived as one of candidate sizesincluding 4, 8, 16, or 32 based on the value of the log2_transform_skip_max_size_minus2 syntax element. For example, when thevalue of the log 2_transform_skip_max_size_minus2 syntax element is 0,the maximum transform skip size may be derived as 4 based on theaforementioned 1<<(log 2_transform_skip_max_size_minus2+2).Alternatively, when the value of the log2_transform_skip_max_size_minus2 syntax element is 1, the maximumtransform skip size may be derived as 8 based on the aforementioned1<<(log 2_transform_skip_max_size_minus2+2). Alternatively, when thevalue of the log 2_transform_skip_max_size_minus2 syntax element is 2,the maximum transform skip size may be derived as 16 based on theaforementioned 1<<(log 2_transform_skip_max_size_minus2+2).Alternatively, when the value of the log2_transform_skip_max_size_minus2 syntax element is 3, the maximumtransform skip size may be derived as 32 based on the aforementioned1<<(log 2_transform_skip_max_size_minus2+2).

For example, the fact that the maximum transform skip size is N mayrepresent that all of the width and the height have the sizes which aresmaller than or equal to N. Alternatively, the fact that the maximumtransform skip size is N may represent that a larger value of the widthand the height has the size which is smaller than or equal to N.Alternatively, the fact that the maximum transform skip size is N mayrepresent that a length of one side has the size which is smaller thanor equal to N in the case of a square block.

Alternatively, for example, the information about the maximum transformskip size may also be included in the high level syntax, the SPS syntax,or the PPS syntax based on the information about whether the transformskip is enabled. For example, when the information about whether thetransform skip is enabled represents the information that the transformskip is enabled, the information about the maximum transform skip sizemay be included in the high level syntax, the SPS syntax, or the PPSsyntax. Alternatively, when the information about whether the transformskip is enabled represents the information that the transform skip isnot enabled, the information about the maximum transform skip size maynot be included in the high level syntax, the SPS syntax, or the PPSsyntax either.

Alternatively, for example, the maximum transform skip size may also bederived based on the information about whether a Multiple TransformSelection (MTS) is enabled. Alternatively, the maximum transform skipsize may be derived based on the information about whether the MTS isenabled and the information about whether the TS is enabled.

For example, the high level syntax may include the information aboutwhether the Multiple Transform Selection (MTS) is enabled or theinformation about whether the TS is enabled. Alternatively, theinformation about whether the MTS is enabled or the information aboutwhether the TS is enabled may be included in the SPS syntax or the PPSsyntax.

For example, the information about whether the MTS is enabled may berepresented by the sps_mts_enabled_flag syntax element. Alternatively,the information about whether the MTS is enabled may include thesps_mts_intra_enabled_flag syntax element or thesps_mts_inter_enabled_flag syntax element. For example, thesps_mts_intra_enabled_flag syntax element or thesps_mts_inter_enabled_flag syntax element may be included in the SPSsyntax based on the sps_mts_enabled_flag syntax element. Thesps_mts_intra_enabled_flag syntax element may be represented by thesps_explicit_mts_intra_enabled_flag syntax element, and thesps_mts_inter_enabled_flag syntax element may be represented by thesps_explicit_mts_inter_enabled_flag syntax element. For example, theinformation about whether the MTS is enabled may also be represented bythe MTS enabled information.

For example, when the information about whether the MTS is enabledrepresents the information that the MTS is enabled, it may berepresented that the MTS enabled=1 or the value of thesps_mts_enabled_flag syntax element is 1. Alternatively, it may berepresented that the value of the sps_mts_enabled_flag syntax element is1, and the value of the sps_explicit_mts_intra_enabled_flag syntaxelement or the sps_explicit_mts_inter_enabled_flag syntax element is 1.Alternatively, when the information about whether the MTS is enabledrepresents the information that the MTS is not enabled, it may berepresented that the MTS enabled=0 or the value of thesps_mts_enabled_flag syntax element is 0. Alternatively, it may berepresented that the value of the sps_mts_enabled_flag syntax element is1, and the value of the sps_explicit_mts_intra_enabled_flag syntaxelement or the sps_explicit_mts_inter_enabled_flag syntax element is 0.For example, according to the setting, the value may also representinformation corresponding to the value inversely.

For example, the information about whether the TS is enabled may berepresented by the TS enabled information or thesps_transform_skip_enabled_flag syntax element. For example, theinformation about whether the TS is enabled may also be represented bythe TS enabled information.

For example, when the information about whether the TS is enabledrepresents the information that the TS is enabled, it may be representedthat the TS enabled=1 or the value of thesps_transform_skip_enabled_flag syntax element is 1. Alternatively, whenthe information about whether the TS is enabled represents theinformation that the TS is not enabled, it may be represented that theTS enabled=0 or the value of the sps_transform_skip_enabled_flag syntaxelement is 0. For example, according to the setting, the value may alsorepresent information corresponding to the value inversely.

For example, based on the information about whether the MTS is enabled,which represents the information that the MTS is enabled, the maximumtransform skip size may be derived based on the size of the MTS. Thatis, when the information about whether the MTS is enabled represents theinformation that the MTS is enabled, the maximum transform skip size maybe derived based on the size of the MTS. That is, the maximum transformskip size may be dependent on the MTS. The size of the MTS may representthe maximum size of the block in which the MTS is enabled. For example,when the size of the MTS is 32 or less, the transform skip may also beenabled for the block having the size of 32 or less.

Alternatively, for example, based on the information about whether theMTS is enabled, which represents the information that the MTS isenabled, the maximum transform skip size may be derived as a presetsize. That is, when the information about whether the MTS is enabledrepresents the information that the MTS is enabled, the maximumtransform skip size may be derived as the preset size. For example, whenthe preset size is 8, the maximum transform skip size may be derived asthe preset size, 8.

Alternatively, for example, based on the information about whether theMTS is enabled, which represents the information that the MTS isenabled, the high level syntax may include the information about themaximum transform skip size, and the maximum transform skip size may bederived based on the information about the maximum transform skip size.That is, when the information about whether the MTS is enabledrepresents the information that the MTS is enabled, the high levelsyntax may separately include the information about the maximumtransform skip size, and the maximum transform skip size may be derivedbased on the information about the maximum transform skip size.Alternatively, for example, when the information about whether the MTSis enabled represents the information that the MTS is enabled, the highlevel syntax may include the information about whether the maximumtransform skip size is derived based on the size of the MTS. When theinformation about whether the maximum transform skip size is derivedbased on the size of the MTS represents the information that the maximumtransform skip size is derived based on the size of the MTS, the highlevel syntax may include the information about the maximum transformskip size. The information about the maximum transform skip size may beincluded in the SPS syntax or the PPS syntax. For example, when theinformation about the maximum transform skip size included in the highlevel syntax represents 32, the maximum transform skip size may bederived as 32 based on the information about the maximum transform skipsize.

Alternatively, for example, based on the information about whether theMTS is enabled, which represents the information that the MTS is notenabled, the maximum transform skip size may be derived as a presetsize. That is, when the information about whether the MTS is enabledrepresents the information that the MTS is not enabled, the maximumtransform skip size may be derived as the preset size. For example, whenthe preset size is 8, the maximum transform skip size may be derived asthe preset size, 8.

Alternatively, for example, based on the information about whether theMTS is enabled, which represents the information that the MTS is notenabled, the high level syntax may include the information about themaximum transform skip size, and the maximum transform skip size may bederived based on the information about the maximum transform skip size.That is, when the information about whether the MTS is enabledrepresents the information that the MTS is not enabled, the high levelsyntax may separately include the information about the maximumtransform skip size, and the maximum transform skip size may be derivedbased on the information about the maximum transform skip size. Theinformation about the maximum transform skip size may be included in theSPS syntax or the PPS syntax. For example, when the information aboutthe maximum transform skip size included in the high level syntaxrepresents 32, the maximum transform skip size may be derived as 32based on the information about the maximum transform skip size.

For example, the residual related information may include the MTS indexinformation about the transform type applied to the current block. Forexample, the MTS index information may be represented by the tu_mts_idxsyntax element or the mts_idx syntax element. For example, the MTS indexinformation may be included in the transform unit syntax or the codingunit syntax. For example, the MTS index information may represent theinformation about the transform type or the transform skip applied tothe current block. Alternatively, the MTS index information mayrepresent the information about the transform type or the transform skipapplied to the current block based on the information about whether theMTS is enabled and/or the information about whether the transform skipis enabled.

For example, the information represented by the MTS index informationmay be derived based on the bin of the bin string for the MTS indexinformation. Alternatively, the information represented by the MTS indexinformation may be derived based on the value of the context index ofthe bin. Alternatively, the information represented by the MTS indexinformation may be derived based on the value of the context index ofthe first bin of the bin string. For example, the context index (ctxIdx)may be derived based on the context index increment (ctxInc) and thecontext index offset (ctxIdxOffset).

For example, the value of the context index of the first bin for the MTSindex information may be derived based on the information about whetherthe MTS is enabled, the information about whether the transform skip isenabled, and the size of the current block. For example, the value ofthe context index of the first bin for the MTS index information may bederived based on Table 19 or Table 22.

For example, based on the information about whether the MTS is enabled,which represents the information that the MTS is enabled and theinformation about whether the transform skip is enabled, whichrepresents the information that the transform skip is enabled, the valueof the context index may be derived by comparing the width of thecurrent block with the height of the current block. That is, when theinformation about whether the MTS is enabled represents the informationthat the MTS is enabled, and the information about whether the TS isenabled represents the information that the TS is enabled, the value ofthe context index may be derived by comparing the width of the currentblock with the height of the current block. Alternatively, when thewidth of the current block and the height of the current block are thesame, the value of the context index may be derived as 0. Alternatively,when the width of the current block is greater than the height of thecurrent block, the value of the context index may be derived as 1, andwhen the width of the current block is smaller than the height of thecurrent block, the value of the context index may be derived as 2.

Alternatively, for example, the value of the context index may bederived based on the information about whether the MTS is enabled, whichrepresents the information that the MTS is enabled, and the codedquad-tree depth (cqtDepth). That is, when the information about whetherthe MTS is enabled represents the information that the MTS is enabled,the value of the context index may be derived based on the cqtDepth. Forexample, the value of the context index may be derived as a valueobtained by adding 1 to the value of the cqtDepth, and may be derived as1, 2, 3, 4, 5, or 6.

Alternatively, for example, based on the information about whether thetransform skip is enabled, which represents the information that thetransform skip is enabled, the value of the context index may be derivedby comparing the width of the current block with the height of thecurrent block. That is, when the information about whether the TS isenabled represents the information that the TS is enabled, the value ofthe context index may be derived by comparing the width of the currentblock with the height of the current block. Alternatively, when thewidth of the current block and the height of the current block are thesame, the value of the context index may be derived as 0. Alternatively,when the width of the current block is greater than the height of thecurrent block, the value of the context index may be derived as 1, andwhen the width of the current block is smaller than the height of thecurrent block, the value of the context index may be derived as 2.

Alternatively, for example, the value of the context index may determinethe ctxInc and/or the ctxIdx based on at least one of the block size,the ratio of the width-to-height of the block, whether to perform theintra or inter prediction of the block, whether to apply the transformskip to the neighbor, or the like. Alternatively, a context model basedon at least one of the block size, the ratio of the width-to-height ofthe block, whether to perform the intra or inter prediction of theblock, whether to apply the transform skip to the neighbor, or the likemay be defined, and the value of the context index may be derived basedon the context model. For example, the information about the transformtype or the transform skip for the current block may be obtained basedon the context index or the context model.

The decoding apparatus may derive prediction samples of the currentblock by performing prediction based on the prediction mode information(S1510). For example, the decoding apparatus may derive a predictionmode of the current block based on the prediction mode information. Forexample, the prediction mode information may include information aboutthe intra prediction mode or information about the inter predictionmode, and the prediction mode of the current block may be derived as theintra prediction mode or the inter prediction mode based on theinformation.

For example, the decoding apparatus may derive the prediction samples ofthe current block based on the prediction mode. For example, when theprediction mode is the intra prediction mode, the decoding apparatus mayderive the prediction samples based on samples around the current block.Alternatively, when the prediction mode is the inter prediction mode,the decoding apparatus may derive the prediction samples based onreference samples within a reference picture of the current block.

The decoding apparatus may derive residual samples of the current blockbased on the residual related information (S1520). For example, theresidual related information may include information about a transformcoefficient for the residual samples. Alternatively, the residualrelated information may also include the transform skip flag.

For example, when the residual related information includes thetransform skip flag, the residual signal (or residual relatedinformation) for the current block may be signaled on the pixel domain(spatial domain) without the transform. Alternatively, when the residualrelated information does not include the transform skip flag, theresidual signal (or residual related information) for the current blockmay be transformed and signaled on the transform domain. For example,the decoding apparatus may derive the residual samples based on theresidual signal which is not transformed or transformed and signaled.

The decoding apparatus may generate reconstruction samples of thecurrent block based on the prediction samples and the residual samples(S1530). Alternatively, the decoding apparatus may derive areconstructed block or a reconstructed picture based on thereconstruction samples. As described above, the decoding apparatus maylater apply an in-loop filtering procedure such as a deblockingfiltering and/or a SAO procedure to the reconstructed picture in orderto improve subjective/objective image quality, if necessary.

The decoding apparatus may obtain image information including all orsome of the aforementioned information (or syntax elements) by decodingthe bitstream. In addition, the bitstream may be stored in a computerreadable digital storage medium, and may cause the aforementioneddecoding method to be performed. For example, the bitstream may also berepresented by image information or video information.

In the aforementioned embodiments, while the methods are described basedon the flowcharts as a series of steps or blocks, the present documentis not limited to the order of steps, and a certain step may occur indifferent order from or simultaneously with a step different from thatdescribed above. In addition, those skilled in the art will understandthat the steps shown in the flowchart are not exclusive and other stepsmay be included or one or more steps in the flowcharts may be deletedwithout affecting the scope of the present document.

The aforementioned method according to the present document may beimplemented in the form of software, and the encoding apparatus and/orthe decoding apparatus according to the present document may be includedin the apparatus for performing image processing of, for example, a TV,a computer, a smartphone, a set-top box, a display device, and the like.

When the embodiments in the present document are implemented insoftware, the aforementioned method may be implemented as a module(process, function, and the like) for performing the above-describedfunction. The module may be stored in a memory and executed by aprocessor. The memory may be located inside or outside the processor,and may be coupled with the processor by various well-known means. Theprocessor may include application-specific integrated circuits (ASICs),other chipsets, logic circuits, and/or data processing devices. Thememory may include a read-only memory (ROM), a random access memory(RAM), a flash memory, a memory card, a storage medium and/or otherstorage devices.

FIG. 17 schematically illustrates a structure of a contents streamingsystem.

That is, the embodiments described in the present document may beperformed by being implemented on a processor, a microprocessor, acontroller, or a chip. For example, the functional units illustrated ineach drawing may be performed by being implemented on the computer, theprocessor, the microprocessor, the controller, or the chip.

In addition, the decoding apparatus and the encoding apparatus to whichthe present document is applied may be included in a multimediabroadcast transceiver, a mobile communication terminal, a home cinemavideo device, a digital cinema video device, a surveillance camera, avideo communication device, a real-time communication device such asvideo communication, a mobile streaming device, a storage medium, acamcorder, a Video on Demand (VoD) service provider, an Over the topvideo (OTT video) device, an Internet streaming service provider, athree-dimensional (3D) video device, a video telephony video device, anda medical video device, and the like, and may be used to process videosignals or data signals. For example, the Over the top video (OTT video)device may include a game console, a Blu-ray player, anInternet-connected TV, a home theater system, a smartphone, a tablet PC,a Digital Video Recorder (DVR), and the like.

In addition, the processing method to which the present document isapplied may be produced in the form of a program executed by a computer,and may be stored in a computer readable recording medium. Themultimedia data having a data structure according to the presentdocument may also be stored in the computer readable recording medium.The computer readable recording medium includes all kinds of storagedevices and distributed storage devices in which computer readable dataare stored. The computer readable recording medium includes, forexample, a Blu-ray Disc (BD), a Universal Serial Bus (USB), a ROM, aPROM, an EPROM, an EEPROM, a RAM, a CD-ROM, a magnetic tape, a floppydisk, and an optical data storage device. In addition, the computerreadable recording medium includes media implemented in the form of acarrier wave (for example, transmission via the Internet). In addition,the bitstream generated by the encoding method may be stored in thecomputer readable recording medium or transmitted through wired/wirelesscommunication networks. In addition, the embodiments of the presentdocument may be implemented as a computer program product by a programcode, and the program code may be executed on the computer according tothe embodiments of the present document. The program code may be storedon a computer readable carrier by the computer.

In addition, the contents streaming system to which the present documentis applied may largely include an encoding server, a streaming server, aweb server, a media storage, a user device, and a multimedia inputdevice.

The encoding server serves to compact the contents, which are input frommultimedia input devices such as a smartphone, a camera, and a camcorderinto digital data, to generate the bitstream and to transmit thebitstream to the streaming server. As another example, when themultimedia input devices such as a smartphone, a camera, and a camcorderdirectly generate the bitstream, the encoding server may be omitted. Thebitstream may be generated by the encoding method or the bitstreamgenerating method to which the present document is applied, and thestreaming server may temporarily store the bitstream in the process oftransmitting or receiving the bitstream.

The streaming server performs the role of transmitting multimedia datato a user device based on a user request through a web server, and theweb server performs the role of informing the user of which services areavailable. If the user requests a desired service from the web server,the web server transmits the request to the streaming server, and thestreaming server transmits multimedia data to the user. At this time,the contents streaming system may include a separate control server, andin this case, the control server performs the role of controllingcommands/responses between devices within the contents streaming system.

The streaming server may receive contents from a media storage and/orencoding server. For example, if contents are received from the encodingserver, the contents may be received in real-time. In this case, toprovide a smooth streaming service, the streaming server may store thebitstream for a predetermined time period.

Examples of the user device may include a mobile phone, smartphone,laptop computer, digital broadcast terminal, personal digital assistant(PDA), portable multimedia player (PMP), navigation terminal, slate PC,tablet PC, ultrabook, wearable device (for example, a smart watch or asmart glass), digital TV, desktop computer, and digital signage. Eachindividual server within the contents streaming system may be operatedas a distributed server, and in this case, data received by each servermay be processed in a distributed manner.

1-13. (canceled)
 14. A method for decoding an image performed by adecoding apparatus, the method comprising: obtaining prediction modeinformation and residual related information from a bitstream; derivingprediction samples of a current block by performing prediction based onthe prediction mode information; deriving residual samples of thecurrent block based on the residual related information; and generatingreconstruction samples of the current block based on the predictionsamples and the residual samples, wherein the residual relatedinformation comprises a transform skip flag based on a size of thecurrent block and a maximum transform skip size, wherein the transformskip flag represents whether a transform skip is applied to the currentblock, wherein information about the maximum transform skip size isobtained from the bitstream, wherein the information about the maximumtransform skip size is comprised in one of a picture parameter set or asequence parameter set, wherein one of the picture parameter set or thesequence parameter set comprises a transform skip enabled flag relatedto whether the transform skip is enabled or not, and wherein theinformation about the maximum transform skip size is comprised in one ofthe picture parameter set or the sequence parameter set based on a valueof the transform skip flag being equal to
 1. 15. The method of claim 14,wherein the information about the maximum transform skip size includes alog 2 transform skip max size minus2 syntax element, wherein the maximumtransform skip size is derived based on the following equation,MaxTsSize=1<<(log 2_transform_skip_max_size_minus2+2) where theMaxTsSize represents the maximum transform skip size, and the log 2transform skip max size minus2 represents a value of the log2_transform_skip_max_size_minus2 syntax element.
 16. The method of claim15, wherein the value of the log 2_transformskipmaxsize_minus2 syntaxelement is represented by one of candidate values of 0 to
 3. 17. Themethod of claim 14, wherein the maximum transform skip size is derivedas one of candidate sizes comprising 4, 8, 16, or
 32. 18. Anon-transitory computer-readable medium storing instructions that, whenexecuted, cause a decoding apparatus to perform operations comprising:obtaining prediction mode information and residual related informationfrom a bitstream; deriving prediction samples of a current block byperforming prediction based on the prediction mode information; derivingresidual samples of the current block based on the residual relatedinformation; and generating reconstruction samples of the current blockbased on the prediction samples and the residual samples, wherein theresidual related information comprises a transform skip flag based on asize of the current block and a maximum transform skip size, wherein thetransform skip flag represents whether a transform skip is applied tothe current block, wherein the information about the maximum transformskip size is comprised in one of a picture parameter set or a sequenceparameter set, and wherein one of the picture parameter set or thesequence parameter set comprises a transform skip enabled flag relatedto whether the transform skip is enabled or not, and wherein theinformation about the maximum transform skip size is comprised in one ofthe picture parameter set or the sequence parameter set based on a valueof the transform skip flag being equal to
 1. 19. The non-transitorycomputer-readable medium of claim 18, wherein the information about themaximum transform skip size includes a log 2 transform skip max sizeminus2 syntax element, wherein the maximum transform skip size isderived based on the following equation,MaxTsSize=1<<(log 2_transform_skip_max_size_minus2+2) where theMaxTsSize represents the maximum transform skip size, and the log 2transform skip max size minus2 represents a value of the log2_transform_skip_max_size_minus2 syntax element.
 20. The non-transitorycomputer-readable medium of claim 19, wherein the value of the log2_transformskipmaxsize_minus2 syntax element is represented by one ofcandidate values of 0 to
 3. 21. The non-transitory computer-readablemedium of claim 18, wherein the maximum transform skip size is derivedas one of candidate sizes comprising 4, 8, 16, or
 32. 22. A decodingapparatus, comprising a memory storing instructions that, when executed,cause one or more processors to perform operations comprising: obtainingprediction mode information and residual related information from abitstream; deriving prediction samples of a current block by performingprediction based on the prediction mode information; deriving residualsamples of the current block based on the residual related information;and generating reconstruction samples of the current block based on theprediction samples and the residual samples, wherein the residualrelated information comprises a transform skip flag based on a size ofthe current block and a maximum transform skip size, wherein thetransform skip flag represents whether a transform skip is applied tothe current block, wherein the information about the maximum transformskip size is comprised in one of a picture parameter set or a sequenceparameter set, wherein one of the picture parameter set or the sequenceparameter set comprises a transform skip enabled flag related to whetherthe transform skip is enabled or not, and wherein the information aboutthe maximum transform skip size is comprised in one of the pictureparameter set or the sequence parameter set based on a value of thetransform skip flag being equal to
 1. 23. The decoding apparatus ofclaim 22, wherein the information about the maximum transform skip sizeincludes a log 2 transform skip max size minus2 syntax element, whereinthe maximum transform skip size is derived based on the followingequation,MaxTsSize=1<<(log 2_transform_skip_max_size_minus2+2) where theMaxTsSize represents the maximum transform skip size, and the log 2transform skip max size minus2 represents a value of the log 2 transformskip max size minus2 syntax element.
 24. The decoding apparatus of claim23, wherein the value of the log 2_transformskipmaxsize_minus2 syntaxelement is represented by one of candidate values of 0 to
 3. 25. Thedecoding apparatus of claim 22, wherein the maximum transform skip sizeis derived as one of candidate sizes comprising 4, 8, 16, or 32.